dotnetmonitor.com

 
Index
Previous
Next

 

Every scenario differs a bit, but a TableLayoutPanel can often address this issue. For instance, if you have the following arrangement:

Simple setting the button to AutoSize (assuming the button is anchored Top, Left) would "push" the form bigger (assuming the Form was AutoSize=true), ala:

 

 

What you really want is for the form to remain its current size and the button to take up space from the textbox. To accomplish this:

  1. Place both in a 2 column, 1 row TableLayoutPanel
  2. Set the Button's column to be AutoSize
  3. Set the TextBox's column to be 100%, and presto, you get:

Terms
Docking Anchor Layout
What happens when I have Dock and Anchors that conflict?
Dock Scenarios
Padding Margin
You have a perf problem with Layout - how to diagnose?