|
-
Nov 14th, 2003, 06:24 AM
#1
Thread Starter
Fanatic Member
Centre the Form
When I am displyaing my MDIChild form, i want to display it at centre of the screen. At design time, setting windowstate for MDIChild form is not allowed.
Pls guide me how to do it at runtime
regards,
prakash
-
Nov 14th, 2003, 07:49 AM
#2
Frenzied Member
you can try something like this (doing it by head)
VB Code:
mdichild.left = (me.width /2) - (mdichild.width / 2)
mdichild.top = (me.height /2) - (mdichild.height /2)
something like that...first get the center of the form containing the child itself.. then set it more left by getting the size of half the child :S.....
though i dont think this is the best way to do it :S
-
Nov 14th, 2003, 08:19 AM
#3
Thread Starter
Fanatic Member
i used to do the same thing in vb 6.0. but i dont think this is supported in .net environment. well, let me try.
is there anything that i can do with...
VB Code:
TwipsToPixelsX
TwipsToPixelsY
PixelsToTwipsX
PixelsToTwipsY
????
-
Nov 14th, 2003, 08:23 AM
#4
Frenzied Member
i think it should work...
though i am pretty sure Twips are removed from vb.net everything is calculated in Pixels now... and for the best.. i hated twips :P
-
Nov 14th, 2003, 10:35 AM
#5
Addicted Member
Just set the startup position to "center parent" or "center screen" at design time.
-
Nov 14th, 2003, 10:49 AM
#6
Thread Starter
Fanatic Member
if its that easy, i would have never posted the query
-
Nov 14th, 2003, 10:51 AM
#7
Addicted Member
so did or didnt that work?
It works for me!
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
|