C#: Could anyone give me good example on how anchoring controls at runtime is done?
Asked
Active
Viewed 171 times
1
-
Could you make yourself a bit more clear? Do you mean how to create new Controls and Add them to your Form? – Tigraine Nov 06 '08 at 11:28
1 Answers
1
textBox1.Multiline = true;
textBox1.Anchor = AnchorStyles.Top | AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Bottom;
Then resize your form and the textbox should grow and shrink while maintaining the same distance from the form edges

Eoin Campbell
- 43,500
- 17
- 101
- 157