For some reason or another the CenterParent value for the Form.StartPosit ion
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
WindowsDefaultL ocation.
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(form 2)
"Bruce" <Br***@nospam.c omwrote in message
news:um******** *****@TK2MSFTNG P04.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.Tran sferStatus
Private Sub RxWaypoints_Cli ck(ByVal eventSender As System.Object, ByVal
eventArgs As System.EventArg s) Handles RxWaypoints.Cli ck
frmTransfer.Sho w(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_Cli ck 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