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
Printable View
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
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
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
????
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
Just set the startup position to "center parent" or "center screen" at design time.
if its that easy, i would have never posted the query :bigyello:
so did or didnt that work?
It works for me!