|
-
Nov 7th, 2000, 01:42 PM
#1
Thread Starter
Lively Member
How can I center Child on a parent window?
Thanks
0101011001000010
01101111011011100110110001101001011011100110010101110010
-
Nov 7th, 2000, 01:47 PM
#2
Frenzied Member
To center a child form into a MDIparent form use
Code:
Form1.Left = (MDI1.ScaleWidth - Form1.ScaleWidth) / 2
Form1.Top = (MDI1.ScaleHeight - Form1.ScaleHeight) / 2
-
Nov 7th, 2000, 02:00 PM
#3
Thread Starter
Lively Member
0101011001000010
01101111011011100110110001101001011011100110010101110010
-
Nov 7th, 2000, 02:02 PM
#4
Frenzied Member
Or just use the move method
This works, too:
Code:
With Form1
.Move (MDIForm1.ScaleWidth - .Width) / 2, _
(MDIForm1.ScaleHeight - .Height) / 2
End With
And I don't believe that you use the ScaleWidth (or ScaleHeight) of Form1 to center it. You use ScaleWidth & ScaleHeight of MDIForm1 (parent form), and Width & Height of Form1 (child form).
Hope that helps!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|