Results 1 to 6 of 6

Thread: Resizing Forms manually

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jun 2004
    Location
    Vancouver, BC, Canada
    Posts
    23

    Resizing Forms manually

    Call me stupid, but how do you change the size of a form with code, (not using the visual interface)

    Code:
            'this is part of the print preview section
            'don't want to maximize or have centered
            '     I am using dual monitors in horizontal mode
            '     center spans both screens, maximize fills both screens
            '     want to be able to size the form to fill only one monitor
            dlgPreview.WindowState = FormWindowState.Normal
            dlgPreview.StartPosition = FormStartPosition.Manual
            'I want to size the form myself here
    Thanks, Chris

  2. #2
    Frenzied Member Mike Hildner's Avatar
    Join Date
    Jul 2002
    Location
    Des Moines, NM
    Posts
    1,690
    You mean like Form.Height and Form.Width?

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Jun 2004
    Location
    Vancouver, BC, Canada
    Posts
    23
    Yes, that's right (sorry forgot to include that)

    I can't seem to get the syntax to change the values

    Chris

  4. #4
    Frenzied Member Mike Hildner's Avatar
    Join Date
    Jul 2002
    Location
    Des Moines, NM
    Posts
    1,690
    What have you tried? Given what you have above, maybe something like
    VB Code:
    1. dlgPreview.Height = 100

  5. #5

    Thread Starter
    Junior Member
    Join Date
    Jun 2004
    Location
    Vancouver, BC, Canada
    Posts
    23
    See, call me stupid

    Here's what I had tried
    dlgPreview.Size.Width = 780

    take out the .size. and voila, it works, thanks a bunch

    Chris

  6. #6
    Frenzied Member Mike Hildner's Avatar
    Join Date
    Jul 2002
    Location
    Des Moines, NM
    Posts
    1,690
    Glad you figured it out. This is where I love Intellisense. Type in dlgPreview, than a dot, and Intellisense show up where you can check out all the methods, properties etc. It's a great learning tool, at least for me.

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