[Vb.net 2005] Auto Sizing Windows
Hey, got a quick question if someone could help me.
I have a form that when i run i want to auto size to the users screen width.
I was able to get the auto size (length and width) but when i run the form it doesn't start in the center, it starts off a bit.
I have tried changing the start position to center, but that didn't help.
Basically when i run the form, 1/4 of the window is off the screen, and i have to move it so its in the center.
Any help would be appreciated.
Thanks
(edit) have another question.
I have a button and when i click it, i would like it to prompt the user to import and image from their hard drive.
Thanks
Re: [Vb.net 2005] Auto Sizing Windows
Quote:
Originally Posted by Wulfgur
Hey, got a quick question if someone could help me.
I have a form that when i run i want to auto size to the users screen width.
I was able to get the auto size (length and width) but when i run the form it doesn't start in the center, it starts off a bit.
I have tried changing the start position to center, but that didn't help.
Basically when i run the form, 1/4 of the window is off the screen, and i have to move it so its in the center.
Any help would be appreciated.
Thanks
(edit) have another question.
I have a button and when i click it, i would like it to prompt the user to import and image from their hard drive.
Thanks
Hi,
You can try in the Form load to change form size like this:
Code:
Me.WindowState = FormWindowState.Maximized
Wkr,
sparrow1
Re: [Vb.net 2005] Auto Sizing Windows
Ok thanks, that worked for the window.
Still the question on, a button when clicked prompts the user to select an image from their hard drive.
Thanks for the help.
Re: [Vb.net 2005] Auto Sizing Windows
Add a "FileOpenDialog" to your form, and use :
FileOpenDialog.Show
to show it to the user.
and about your first Q, you can change the size and position of your forms according to screen size by using for example
Me.Width=Screen.Width
Me.Height=Screen.Height
etc.
Re: [Vb.net 2005] Auto Sizing Windows