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