|
-
Jan 19th, 2006, 03:51 AM
#1
Thread Starter
Lively Member
How Do I Create A Control Array Like I Did In VB6
I want to create a control array but I would like to do so by drawing them in design mode. I know how to create control array with code but then I have to manually type the x,y for each control. I have a program with 50+ controls.
Any ideas?
-
Jan 19th, 2006, 04:04 AM
#2
Addicted Member
Re: How Do I Create A Control Array Like I Did In VB6
You cant create a control array during design time, maybe you could group all the controls together on one panel and index them like so...
int i = 0;
foreach(Control c in panel1.Controls)
{
c.Text = i.ToString();
i++;
}
or even like this...
panel1.Controls[0].Text = string.Empty;
You dont need eyes to see, you need vision.
-
Jan 21st, 2006, 03:14 PM
#3
Re: How Do I Create A Control Array Like I Did In VB6
You can just make an array of controls.
textbox[] boxes = new textbox[5];
...
I don't live here any more.
-
Jan 22nd, 2006, 11:57 AM
#4
Thread Starter
Lively Member
Re: How Do I Create A Control Array Like I Did In VB6
yeah i knew that .... i just didnt want to set the x, y for 50+ controls
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|