Automatically resize form

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • monadel
    New Member
    • Sep 2007
    • 17

    Automatically resize form

    Hi guys,

    How do you resize a form in VB. Basically when user drag the form to minimise or maximise, it will resize all the components inside the form.

    thanks
  • Killer42
    Recognized Expert Expert
    • Oct 2006
    • 8429

    #2
    Originally posted by monadel
    How do you resize a form in VB. Basically when user drag the form to minimise or maximise, it will resize all the components inside the form.
    Probably depends on what version of VB you are using. But generally, the same way you set the size at any other time - by adjusting the Top/Left/Width/Height properties, using the .Move method, or whatever. It's up to you to decide where you want them.

    You might also try searching TheScripts for the terms VB and ELASTIC together. There is a class of controls known as "elastic" controls which help to automate this kind of thing.

    Comment

    • nev
      Contributor
      • Oct 2007
      • 251

      #3
      public cw as integer = control.width

      control.width = form.width - cw

      same goes to height

      Comment

      • QVeen72
        Recognized Expert Top Contributor
        • Oct 2006
        • 1445

        #4
        Hi,

        Re-sizing the Controls inside the Form, is not a very good Idea. as When you Decrease/Increase the Size of Cotrols, Correspondingly , the Font Size should also decrease/Increase, this may give your form a Clums- Cluttered Look. May be you can just make the Form with fixed set of say 3-4 sizes, and allow users to choose from them.

        Regards
        Veena

        Comment

        Working...