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

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

textbox resize with window

Your answer

Try to answer the question as detailed as possible.
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 (6.6k 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 30 views
0 like 0 dislike
1 answer 22 views
0 like 0 dislike
1 answer 7 views
0 like 0 dislike
1 answer 32 views
0 like 0 dislike
1 answer 8 views
0 like 0 dislike
1 answer 26 views
0 like 0 dislike
1 answer 4 views
0 like 0 dislike
1 answer 4 views
...