473,326 Members | 1,972 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Why isn't form centering in parent?

I have the StartPosition property set to CenterParent for
GarXfaceUI.TransferStatus.

The button below is on another form. Why isn't
GarXfaceUI.TransferStatus being centered in the parent?
Private Sub RxWaypoints_Click(ByVal eventSender As System.Object, ByVal
eventArgs As System.EventArgs) Handles RxWaypoints.Click
Private frmTransfer As New GarXfaceUI.TransferStatus
frmTransfer.Show(Me)

End Sub


--
Bruce E. Stemplewski
GarXface OCX and C++ Class Library for the Garmin GPS
www.stempsoft.com
Jan 2 '07 #1
5 1575
Bruce,
The button below is on another form. Why isn't GarXfaceUI.TransferStatus
being centered in the parent?
Because that you only call a method which does nothing.

Cor

"Bruce" <Br***@nospam.comschreef in bericht
news:OT**************@TK2MSFTNGP04.phx.gbl...
>I have the StartPosition property set to CenterParent for
GarXfaceUI.TransferStatus.

The button below is on another form. Why isn't GarXfaceUI.TransferStatus
being centered in the parent?
Private Sub RxWaypoints_Click(ByVal eventSender As System.Object, ByVal
eventArgs As System.EventArgs) Handles RxWaypoints.Click
Private frmTransfer As New GarXfaceUI.TransferStatus
frmTransfer.Show(Me)

End Sub


--
Bruce E. Stemplewski
GarXface OCX and C++ Class Library for the Garmin GPS
www.stempsoft.com

Jan 2 '07 #2
"Bruce" <Br***@nospam.comschrieb:
Private Sub RxWaypoints_Click(ByVal eventSender As System.Object, ByVal
eventArgs As System.EventArgs) Handles RxWaypoints.Click
Private frmTransfer As New GarXfaceUI.TransferStatus
frmTransfer.Show(Me)

End Sub
Your code does not compile because 'Private' cannot be used inside a method.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Jan 2 '07 #3
Herfried K. Wagner [MVP] wrote:
>
Your code does not compile because 'Private' cannot be used inside a
method.

It is actually global

Private frmTransfer As New GarXfaceUI.TransferStatus

Private Sub RxWaypoints_Click(ByVal eventSender As System.Object, ByVal
eventArgs As System.EventArgs) Handles RxWaypoints.Click

frmTransfer.Show(Me)

End Sub

I just pasted in in for ease of viewing the code. The code compiles and
runs the second dialog just does not center on the parent.

RxWaypoints_Click is a button on one form that shows a second form
(dialog box).

--
Bruce E. Stemplewski
GarXface OCX and C++ Class Library for the Garmin GPS
www.stempsoft.com
Jan 3 '07 #4
Cor Ligthert [MVP] wrote:
Bruce,
>The button below is on another form. Why isn't GarXfaceUI.TransferStatus
being centered in the parent?

Because that you only call a method which does nothing.

Cor

"Bruce" <Br***@nospam.comschreef in bericht
news:OT**************@TK2MSFTNGP04.phx.gbl...
>I have the StartPosition property set to CenterParent for
GarXfaceUI.TransferStatus.

The button below is on another form. Why isn't GarXfaceUI.TransferStatus
being centered in the parent?
Private Sub RxWaypoints_Click(ByVal eventSender As System.Object, ByVal
eventArgs As System.EventArgs) Handles RxWaypoints.Click
Private frmTransfer As New GarXfaceUI.TransferStatus
frmTransfer.Show(Me)

End Sub


--
Bruce E. Stemplewski
GarXface OCX and C++ Class Library for the Garmin GPS
www.stempsoft.com

It is actually global

Private frmTransfer As New GarXfaceUI.TransferStatus

Private Sub RxWaypoints_Click(ByVal eventSender As System.Object, ByVal
eventArgs As System.EventArgs) Handles RxWaypoints.Click

frmTransfer.Show(Me)

End Sub

I just pasted in in for ease of viewing the code. The code compiles and
runs the second dialog just does not center on the parent.
--
Bruce E. Stemplewski
GarXface OCX and C++ Class Library for the Garmin GPS
www.stempsoft.com
Jan 3 '07 #5
For some reason or another the CenterParent value for the Form.StartPosition
property is only honoured if a form is shown using the ShowDialog method.

When the show method is used and the StartPosition property is set to
CenterParent then the behaviour is the same as if was set to
WindowsDefaultLocation.

Passing a 'parent' to the method has no effect on this. The 'parent'
paramter is used where you want the form to be 'parented' to yet another
form.

Say you have a Form (form1) from which you have 'shown' a another Form
(form2). You also have another Form (form3) that you 'show' from form1 but
want it 'parented' to form2. To do this you execute the statement (in
form1):

form3.Show(form2)
"Bruce" <Br***@nospam.comwrote in message
news:um*************@TK2MSFTNGP04.phx.gbl...
Herfried K. Wagner [MVP] wrote:
>>
Your code does not compile because 'Private' cannot be used inside a
method.


It is actually global

Private frmTransfer As New GarXfaceUI.TransferStatus

Private Sub RxWaypoints_Click(ByVal eventSender As System.Object, ByVal
eventArgs As System.EventArgs) Handles RxWaypoints.Click

frmTransfer.Show(Me)

End Sub

I just pasted in in for ease of viewing the code. The code compiles and
runs the second dialog just does not center on the parent.

RxWaypoints_Click is a button on one form that shows a second form (dialog
box).

--
Bruce E. Stemplewski
GarXface OCX and C++ Class Library for the Garmin GPS
www.stempsoft.com

Jan 3 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Chris | last post by:
Hi, I am pretty new to CSS authoring and find myself in a tricky situation. I have a series of divs (dynamically generated - there could be up to 8) as follows: <div class="person">...
3
by: CMAR | last post by:
To center my <div>, I am currently using something like <div id="navcontainer" align="center"> This centers fine, but is deprecated code. I have seen these two solutions recommended. 1) ...
2
by: Robert W. | last post by:
In my WinForms application, I have a main form, which may or may not be visible depending on the user's wishes. This main form initiates a separate thread that starts a data transfer process. ...
7
by: Peter | last post by:
I have a primary form named frmMain. During some extended data pulls I launch another Dialog Form named frmUpdating. How do I keep the frmUpdating centered on the frmMain if a user moves the...
3
by: Zack Sessions | last post by:
I am using VB.NET 2003. I have read the threads concerning the problem where the FormStartPosition of CenterParent is ignored if the form is displayed with the Show method as opposed to the...
3
by: wmasterj | last post by:
I have a div i want it to be max a certain width - thats done already But - i want the empty sides of the div to have the same width - like with frames (cols="*,800, *") So no matter how much i...
3
by: John Pote | last post by:
1. Horizontal centering a <divin browser window. The current trend seems to be to place page content in a fixed width area in the middle of the browser window. How is this achieved? If I use a...
5
by: Markus Ernst | last post by:
Hello This is a test example: http://www.markusernst.ch/anthracite/ http://www.markusernst.ch/anthracite/living_divani.html After googling and experimenting for several hours, I ended up...
2
by: rudicheow | last post by:
SHORT VERSION ============= I have a bunch of identical fixed-size single-celled tables that rest against each other horizontally thanks to "float:left". These tables are dynamically generated...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.