0 like 0 dislike
12k views
asked in Programming by (4.8k points)

How I can to make stretching a textbox to fit the containing window in Windows Forms?

textbox resize with window

Your answer

pre, code

Preview

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please log in or register.

1 Answer

0 like 0 dislike
answered by (4.8k points)

Use the Anchor property to define how a control is automatically resized as its parent control is resized. Anchoring a control to its parent control ensures that the anchored edges remain in the same position relative to the edges of the parent control when the parent control is resized.

Do not forget to assign MinimumSize and MaximumSize of the control these properties helps for the control to have certain minimum or maximum size if you resize your form too small or too big.

Related questions

0 like 0 dislike
1 answer 13 views
0 like 0 dislike
1 answer 17 views
0 like 0 dislike
1 answer 14 views
0 like 0 dislike
1 answer 15 views
0 like 0 dislike
1 answer 8 views
0 like 0 dislike
1 answer 25 views
0 like 0 dislike
1 answer 12 views
0 like 0 dislike
1 answer 15 views
...