Link to home
Start Free TrialLog in
Avatar of DiamonDogX
DiamonDogX

asked on

Dynamically sizing WinForms components

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!!
ASKER CERTIFIED SOLUTION
Avatar of aaronfeng
aaronfeng

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Éric Moreau
Hi DiamonDogX,

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

Cheers!
Avatar of DiamonDogX
DiamonDogX

ASKER

Thanks!
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...