OK, I'm lost. How do you iterate through a specific set of controls
Ex, in VB6, you would do the following:
For Ea = 0 To 3
TxtBox(Ea)= "Test" & Ea
lblLabel(Ea) = "Label" & Ea
Next
Now, in VB.NET the only way seems to do:
TxtBox0.Text = "Test0"
lblLabel0.Text = "Label0"
TxtBox1.Text = "Test1"
lblLabel1.Text = "Label1"
TxtBox2.Text = "Test2"
lblLabel2.Text = "Label2"
TxtBox3.Text = "Test3"
lblLabel3.Text = "Label3"
There has GOT to be a better way. Any help would be much appreciated.
Thanks,
Denvas

Where did Control Arrays go in VB.NET?
Sallu
Esteban Garcia
VanP
public void dbgprntControls(Control mainCntrl)
{
//System.Windows.Forms.Control ctrl = new Control() ;
foreach (Control ctrl in mainCntrl.Controls )
{
Debug.Write("name:");
Debug.Write(ctrl.Name);
Debug.Write('\t');
Debug.Write("tabidx");
Debug.Write(ctrl.TabIndex);
Debug.Write('\t');
Debug.Write("tabstp:");
Debug.Write(ctrl.TabStop);
Debug.Write('\t');
Debug.Write("text:");
Debug.Write(ctrl.Text);
Debug.Write('\t');
Debug.Write("tag:");
Debug.Write(ctrl.Tag);
Debug.WriteLine("");
if (ctrl.HasChildren )
{
dbgprntControls(ctrl);
}
}
Obviously, do whatever instead of debug.write - I'm in the process of using this to initialize properties of edit controls on my forms to read the tag property and set edit masks as set at design time, and/or persisted in a data dictionary or perhaps via Keys.
Anyway hope this helps.
Ben Riga
Much appreciated,
Denvas