Windows Develop Bookmark and Share   
 index > Windows Forms Designer > Resizing user control
 

Resizing user control

I Have a usercontrol which contains several controls that I want toresize according to it's anchors whenever the size of theparent form changes. Some controlscontained in te UC aren't supose to resize at least in y axis, like a combo and a check box, but the textbox is in both. Could you point me in the right direction and perhaps show me an example?

Thanks in advance.

Pedro Costa  Tuesday, April 04, 2006 10:33 AM

Use a TableLayout control with an applicable number of rows and columns, ensure that the layout control uses Dock=Fill, and percentages for row/column sizes. Fill the table cells with e.g. Panel controls and use rowspan and colspan as needed to make it easier to add multiple controls to a cell.

Then add your controls to the panels, and use Dock=Fill on your textbox controls to make it resize with the underlying table cell when your user control gets resized.

KjellSJ  Wednesday, April 05, 2006 2:19 PM

You can use google to search for other answers

Custom Search

More Threads

• :: Nested Control does not save its properties ::
• Property & Component
• Designer Verbs for Forms
• Icons
• My Data Binding Solution for a "Browse for Drive" Dialog Box
• Exposing a Component Control of a UserControl
• Custom Controls with Visual C++ .NET
• How to implement a design-time complex property custom editor
• Strange Problem in Windows form
• Design Surface - Collection type properties not firing ComponentChanged