?
Solved

Dynamically sizing WinForms components

Posted on 2006-05-26
4
Medium Priority
?
488 Views
Last Modified: 2010-04-16
I have an application that consists of a window... and inside that window I had a tab control, which contains various other controls (text boxes, etc.).  When I maximize the window, I'd like the tab control to resize along with the window instead of staying the size I initially set it at.  It would also be interesting to see if I could get the other controls to resize appropriately as well, but the tab control is the main thing.  Thanks!!
0
Comment
Question by:DiamonDogX
  • 2
4 Comments
 
LVL 5

Accepted Solution

by:
aaronfeng earned 200 total points
ID: 16774125
Two possible ways you can do this:

If you don't mind theTabControl covers the whole form you can just set the Dock property to Fill on the TabControl.  If you don't want the TabControl to fill the whole form, you can position the TabControl to whereever you would like then anchor it on all 4 sides to the form.

Cheers,

Aaron
0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 16775383
Hi DiamonDogX,

Use the Anchor property of each control to attach to the borders you want. When the borders move, the controls resize.

Cheers!
0
 

Author Comment

by:DiamonDogX
ID: 16777066
Thanks!
0
 

Author Comment

by:DiamonDogX
ID: 16777155
But wait!  Now when I resize my window (with the mouse) to a larger size, I can't shrink it back again!  The tab control's size seemed to be locked whenever I increase size...
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Suggested Courses

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question