Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

.Net controls

Status
Not open for further replies.

powerpc

Programmer
Joined
Mar 10, 2003
Messages
6
Location
US
How to load Controls dynamically in .NET
 
Could do something like this:
(f2 denotes a form instance, sloppy, but its late)


System.Windows.Forms.TextBox[] x = new System.Windows.Forms.TextBox[15];
x[1]= new System.Windows.Forms.TextBox();
x[1].Visible = true;
x[1].Top = 100;
x[1].Left = 100;
x[1].Parent = f2;
x[2] = new System.Windows.Forms.TextBox();
x[2].Visible = true;
x[2].Top = 130;
x[2].Left = 100;
x[2].Parent = f2;
x[3] = new System.Windows.Forms.TextBox();
x[3].Top = 160;
x[3].Left = 100;
x[3].Visible = true;
x[3].Parent = f2;

etc..........
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top