How to open the MDI Parent form in center to the MDI form.
Align Center
Collapse
X
-
In your version is there a property called:
"StartPossition " on the form?
if so choose centerparent -
When I try to Change MDI Child Form's StartUpPosition Property to 1-Center Owner (or) 2-Center Screen (or) 3-Windows Default then "Invalid Property Value" Error Msg appear.Originally posted by shuvo2k6u can try by changing this Property
"StartUpPositio n"
i am not sure. OK, try.
Thanks AdvanceComment
-
Im not sure in vb6, but why not make your own Code?
try somthing like
MDIChildForm.To p = mdiparent.Heigh t - mdiparent.Heigh t / 2
MDIChildForm.Le ft = mdiparent.Width - mdiparent.Width / 2
you can see where its goin..?
Also in case they are different in vb6;
Top = the position of the top of the mdi child form in the mdi parent form
Left = the position of the left of the mdi child form in the mdi parent formComment
-
chld.Top = (MDIForm.Height - chld.Height) / 2Originally posted by pentahariWhen I try to Change MDI Child Form's StartUpPosition Property to 1-Center Owner (or) 2-Center Screen (or) 3-Windows Default then "Invalid Property Value" Error Msg appear.
Thanks Advance
chld.Left = (MDIForm.Width - chld.Width) / 2Comment
-
Private Sub mnulogin_Click( )
CenterChild Mainform, Login
End Sub
Sub CenterChild(Par ent As Form, Child As Form)
On Error Resume Next
Dim iTop As Integer
Dim iLeft As Integer
iTop =(Parent.Height - Child.Height) / 2)
iLeft = (Parent.Width - Child.Width) / 2)
Child.Move iLeft, iTop
End Sub
I find the Correct Coding for this question.
My mistake is don't insert Form.Move functionComment
-
I cann't understand what is difference between This code and ur code:Originally posted by pentahariPrivate Sub mnulogin_Click( )
CenterChild Mainform, Login
End Sub
Sub CenterChild(Par ent As Form, Child As Form)
On Error Resume Next
Dim iTop As Integer
Dim iLeft As Integer
iTop =(Parent.Height - Child.Height) / 2)
iLeft = (Parent.Width - Child.Width) / 2)
Child.Move iLeft, iTop
End Sub
I find the Correct Coding for this question.
My mistake is don't insert Form.Move function
Thnx, good luck.Code:Private Sub Command1_Click() Load Child Child.Top = (Parent.Height - Child.Height) / 2 Child.Left = (Parent.Width - Child.Width) / 2 Child.Show End Sub
Comment
-
Sorry i have the mistake, your code is very correctly and clearly.Originally posted by shuvo2k6I cann't understand what is difference between This code and ur code:
Thnx, good luck.Code:Private Sub Command1_Click() Load Child Child.Top = (Parent.Height - Child.Height) / 2 Child.Left = (Parent.Width - Child.Width) / 2 Child.Show End Sub
Thank you very much for your reply.
Please give the reply for me. I am waiting for your reply.Comment
Comment