The ff. is what I am using to determine the center (horizontal) of the screen in VB6.0, I can't seem to find it's equivalent in VB.Net, I hope somebody helps...
VB Code:
(Screen.Width / Screen.TwipsPerPixelX) / 2
Printable View
The ff. is what I am using to determine the center (horizontal) of the screen in VB6.0, I can't seem to find it's equivalent in VB.Net, I hope somebody helps...
VB Code:
(Screen.Width / Screen.TwipsPerPixelX) / 2
Me.CenterToScreen() can be used to center the form.. unless you need to know the pixels positions...
???
User your ruler and measure half the height and half the width and then draw a mark. That is your center screen in VB.NET :D
VB Code:
Screen.PrimaryScreen.Bounds.Width / 2 Screen.PrimaryScreen.Bounds.Height / 2
Darn, I don't have a ruler right now... :( Thanks! :D
I havent used .CenterToScreen but the help file shows...
So how is to be used then?Quote:
This member supports the .NET Framework infrastructure and is not intended to be used directly from your code.
Hmmm... that is very interesting.. don't know the repurcussions of doing it, but it does center the form on the screen... A guess would be that it is used when setting the start position of your form or whatnot... and wasn't intended to be used directly in the code... but if it works..................