Home
Search
 
What's New
Index
Books
Links
Q & A
Newsletter
Banners
 
Feedback
Tip Jar
 
C# Helper...
 
XML RSS Feed
Follow VBHelper on Twitter
 
 
 
MSDN Visual Basic Community
 
 
 
 
TitleMake a dialog that stretches controls on the right to take advantage of its full size in VB .NET
Keywordsstretch, Anchor, VB .NET
CategoriesControls, VB.NET, Software Engineering
 
Many dialogs have controls that can stretch to the right when the form resizes. For example, a contact entry might have a series of Labels and TextBoxes for name, address, and so forth. When the form gets wider, it is useful to make the TextBoxes wider to use the available space.

Position the controls. Then set the TextBox's Anchor properties to Top, Left, Right. The rest is automatic.

If you want controls to the right of those that stretch, for example OK and Cancel buttons, set their Anchor properties to Top, Right.

 
 
Copyright © 1997-2010 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated