Results 1 to 5 of 5

Thread: How to auto resize controls on the form in Vb.Net?

  1. #1
    Join Date
    Jan 2009
    Posts
    22

    How to auto resize controls on the form in Vb.Net?

    Hello!

    Well I dont know how to explain this but when I resize a form in my application the form resizes without adjusting the controls on it I mean to say that If I have only 2 controls on a form a lable box & 1 textbox.

    Lable box is on top & textbox at bottom then if i make the form smaller then the textbox gets dissapered. I want to know how to make these controls to adjust with form resize? I have sen this with many application but don't know how they do this?

  2. #2
    Join Date
    Jan 2009
    Posts
    44

    Re: How to auto resize controls on the form in Vb.Net?

    If you want controls on your form to resize along with the form you'll need to add some code to accomplish this in the Form_Resize event. In your case you could determine the size of the textboxes in proportion to the dimensions of the form and center the command buttons based on their width(s) and the width of the form.

  3. #3
    Join Date
    Jan 2009
    Posts
    36

    Re: How to auto resize controls on the form in Vb.Net?

    All controls have Anchor and Dock properties, which are useful to automatically stretch/align them when the form is resized. You can experiment with the Windows Forms Designer (select a control, go to its properties and set, for example, Anchor to Left, Top, Right, Bottom).

  4. #4
    Join Date
    Feb 2009
    Posts
    12

    Re: How to auto resize controls on the form in Vb.Net?


  5. #5
    Join Date
    Jan 2009
    Posts
    22

    Re: How to auto resize controls on the form in Vb.Net?

    Hello friends thanks a lot for your replies!

    All controls have Anchor and Dock properties, which are useful to automatically stretch/align them when the form is resized.
    and
    you'll need to add some code to accomplish this in the Form_Resize event.
    I will give it a try!

    Thanks for that link too!

Similar Threads

  1. Replies: 2
    Last Post: 02-05-2011, 07:06 AM
  2. How to Auto Populate fields from sub form to form?
    By mich43 in forum Windows Software
    Replies: 6
    Last Post: 09-11-2010, 11:29 PM
  3. TWebBrowser Auto Resize?
    By alex198555 in forum Software Development
    Replies: 1
    Last Post: 27-07-2010, 09:42 AM
  4. Controls move while typing in Word Form
    By Measurer in forum Windows Software
    Replies: 5
    Last Post: 16-01-2010, 03:43 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,017,670.46334 seconds with 17 queries