Results 1 to 5 of 5

Thread: [Vb.net 2005] Auto Sizing Windows

  1. #1

    Thread Starter
    Member
    Join Date
    Oct 2006
    Posts
    63

    Resolved [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
    Last edited by Wulfgur; Apr 28th, 2007 at 08:34 AM.

  2. #2
    PowerPoster sparrow1's Avatar
    Join Date
    May 2005
    Location
    Globetrotter
    Posts
    2,820

    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
    Wkr,
    sparrow1

    If I helped you, don't forget to Rate my post. Thank you

    I'm using Visual Studio.Net 2003 and
    2005
    How to learn VB.Net Create setup with VB 2005 Drawing for beginners VB.Net Tutorials GDI+ Tutorials
    Video's for beginners

  3. #3

    Thread Starter
    Member
    Join Date
    Oct 2006
    Posts
    63

    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.

  4. #4
    Addicted Member javad2000's Avatar
    Join Date
    Dec 2006
    Posts
    238

    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.

  5. #5

    Thread Starter
    Member
    Join Date
    Oct 2006
    Posts
    63

    Resolved Re: [Vb.net 2005] Auto Sizing Windows

    Ok thanks for the help.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width