How to make all textboxes be in a array?

  • Thread starter Thread starter woodpecker
  • Start date Start date
W

woodpecker

I have many textboxes in my application,I feel very unconvenient when
dealing with many textboxes,if the VB.NET can manage them as a array like
what the VB6 do?

Anybody can help me?

Thanks and regards.

Woodpecker
 
woodpecker said:
I have many textboxes in my application,I feel very unconvenient
when dealing with many textboxes,if the VB.NET can manage them as a
array like what the VB6 do?

Yes, we still have arrays:

dim MyTextboxes as textbox() = {txt1, txt2, txt3}

Now they are in an array. Of course, the code has to be executed after the
call to InitializeComponent. Control arrays like in VB6 are not required
anymore.

Alternative syntax:

dim MyTextboxes as textbox()
'...later
MyTextboxes = New textbox(){txt1, txt2, txt3}
 
Back
Top