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:
- Place both in a 2 column, 1 row TableLayoutPanel
- Set the Button's column to be AutoSize
- Set the TextBox's column to be 100%, and presto, you get:
![]()