Forms Automatically fullscreen...

PHTech

Senior Member
Joined
Aug 21, 2006
Messages
588
Reaction score
0
Location
Witbank
Hi there...

Is there a way how I can automatically make a form in Visual Basic fullscreen when it loads...? And if then, how can I make everything in the form also centre in any screen res...? Like all the elements in a form stays in the centre even if the form is resizing...?

BTW. I am using Visual Studio 2008...
 
Hi there...

Is there a way how I can automatically make a form in Visual Basic fullscreen when it loads...? And if then, how can I make everything in the form also centre in any screen res...? Like all the elements in a form stays in the centre even if the form is resizing...?

BTW. I am using Visual Studio 2008...

fullScreen -> Look @ the WindowState Property

To Center everything when the form is resized... If that's your requirement, I'd suggest drop all your elements into a panel. You know the size of the panel, and you'll know the size of the form if you use the Resize events on the form. You can do the maths and set the position property of the panel.

X = (Form.Width - Panel.Width) / 2;
 
look at the form properties... down by the properties window..
 
fullScreen -> Look @ the WindowState Property

To Center everything when the form is resized... If that's your requirement, I'd suggest drop all your elements into a panel. You know the size of the panel, and you'll know the size of the form if you use the Resize events on the form. You can do the maths and set the position property of the panel.

X = (Form.Width - Panel.Width) / 2;

Mark as "answer" so Bcm can receive the credits due... :p
 
FYI, if you need to make a form fullscreen but keep all elements centered you're doing something wrong in your UI design....

Whats the purpose of the form anyway?
 
FYI, if you need to make a form fullscreen but keep all elements centered you're doing something wrong in your UI design....

That's a very broad statement considering you don't know a thing about the guys requirements (or even better, his clients requests)
 
THANX alot for your answers guys...! BCM's answer will most likely do the trick...! THANX...!
 
That's a very broad statement considering you don't know a thing about the guys requirements (or even better, his clients requests)

It is a very broad statement. However, if (what I'm assuming) he needs to focus on a specific form without the user being able to click back on the previous form, he's better off using dialogs than trying to fullscreen it so the user can't click back unless they close it.

I have no issue with him trying to make things fullscreen blablablabla. What rang a warning bell in my mind was keeping everything else centered.

Sure it has its uses. But I won't use a lead hammer on nails...
 
Top
Sign up to the MyBroadband newsletter
X