Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Resizing Control Added At Runtime
Message
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Miscellaneous
Thread ID:
01390138
Message ID:
01390168
Views:
45
>I am adding a usercontrol to a form at runtime. If the control is on the form, and the form is resized, how do I resize the control? I'm not sure how to check to see of the control is on the form and how to get a reference to it.
>
>Thanks

You can use anchor something like this
this.textBox = new TextBox();
this.textBox.Location = new Point(100, 100);
this.textBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right)));
this.Controls.Add(this.textBox);
Semper ubi sub ubi.
Previous
Reply
Map
View

Click here to load this message in the networking platform