Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 14-02-2009
Member
 
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?
Reply With Quote
  #2  
Old 14-02-2009
Member
 
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.
Reply With Quote
  #3  
Old 14-02-2009
Member
 
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).
Reply With Quote
  #4  
Old 14-02-2009
Member
 
Join Date: Feb 2009
Posts: 12
Re: How to auto resize controls on the form in Vb.Net?

Try this:
http://www.filetransit.com/view.php?id=25827

Hope this helps!
Reply With Quote
  #5  
Old 16-02-2009
Member
 
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!

Quote:
All controls have Anchor and Dock properties, which are useful to automatically stretch/align them when the form is resized.
and
Quote:
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!
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "How to auto resize controls on the form in Vb.Net?"
Thread Thread Starter Forum Replies Last Post
how to get items in a form to auto-resize with the form using visual basic deansmylie93 Software Development 2 02-05-2011 07:06 AM
How to Auto Populate fields from sub form to form? mich43 Windows Software 6 09-11-2010 11:29 PM
TWebBrowser Auto Resize? alex198555 Software Development 1 27-07-2010 09:42 AM
Controls move while typing in Word Form Measurer Windows Software 5 16-01-2010 03:43 PM


All times are GMT +5.5. The time now is 05:59 PM.