dcsimg
Results 1 to 3 of 3

Thread: Resizing form and controls

  1. #1

    Thread Starter
    Wait... what? weirddemon's Avatar
    Join Date
    Jan 2009
    Location
    USA
    Posts
    3,828

    Resizing form and controls

    I have a form that sits on the user's desktop. It's only purpose is to display specific information about the computer. The layout is basically setup like this:

    =========TITLE==========
    = ITEM - ***......................=
    = ITEM - ***......................=
    = .......................=
    = ITEM - ***......................=
    = ITEM - ***......................=
    =======================

    I want to be able to give the user the option to display whatever data they choose. In doing so, I'd like the form to resize itself based on the how many labels are in the form and for the labels to align vertically.

    Can anyone point me in the right direction? For the form, I was thinking I could get the location of the last label and offset it's size by the location, or something similar.

    Thanks
    CodeBank contributions: Process Manager, Temp File Cleaner

    Quote Originally Posted by SJWhiteley
    "game trainer" is the same as calling the act of robbing a bank "wealth redistribution"....

  2. #2
    PowerPoster 2.0 Negative0's Avatar
    Join Date
    Jun 2000
    Location
    Southeastern MI
    Posts
    4,367

    Re: Resizing form and controls

    You can use the Form's AutoSize and AutoSizeMode properties to have it grow. So if you programmatically add controls, it will automatically resize to show the newly drawn controls. I would set AutoSize = True and AutoSizeMode to GrowAndShrink.

  3. #3

    Thread Starter
    Wait... what? weirddemon's Avatar
    Join Date
    Jan 2009
    Location
    USA
    Posts
    3,828

    Re: Resizing form and controls

    Quote Originally Posted by Negative0 View Post
    You can use the Form's AutoSize and AutoSizeMode properties to have it grow. So if you programmatically add controls, it will automatically resize to show the newly drawn controls. I would set AutoSize = True and AutoSizeMode to GrowAndShrink.
    Ah. Gotcha. That should work then.

    But what about the controls? I bet if I group them into panels, there's probably something that would allow me to align them.
    CodeBank contributions: Process Manager, Temp File Cleaner

    Quote Originally Posted by SJWhiteley
    "game trainer" is the same as calling the act of robbing a bank "wealth redistribution"....

Posting Permissions

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



Featured


Click Here to Expand Forum to Full Width