Control arrays converted from VB6

G

Greg Lesnie

In VB6 I made heavy use of control arrays
I see they have been 'deprecated' in vb.Net, with a questionable explanation
that they are no longer necessary!
Problem is I commonly associated several controls with the same index - eg a
Directory listbox, Label, Checkbox, Textbox etc
Now I see Control arrays belong to VB6 compatibility.

So how in a converted VB6 program can I extend the control arrays at design
time? or run-time for that matter?

I guess VB6 compatibility creates a run-time array of controls with related
type and names - am I right?

So do I need to create a Control object array at form load time, and replace
control references with array references? Is that how VB6 compatibility
does it?

How do other people handle control arrays in .Net

Thanks!
 
G

Guest

Yes I know there have been many discussions about control arrays, just
seeking method for DESIGN TIME maintenance together with best conversion
strategy which minimises code change
 
K

Ken Tucker [MVP]

Hi,

http://www.windowsforms.com/default.aspx?tabindex=6&tabid=47&ItemID=16&mid=142

Ken
-----------------------
In VB6 I made heavy use of control arrays
I see they have been 'deprecated' in vb.Net, with a questionable explanation
that they are no longer necessary!
Problem is I commonly associated several controls with the same index - eg a
Directory listbox, Label, Checkbox, Textbox etc
Now I see Control arrays belong to VB6 compatibility.

So how in a converted VB6 program can I extend the control arrays at design
time? or run-time for that matter?

I guess VB6 compatibility creates a run-time array of controls with related
type and names - am I right?

So do I need to create a Control object array at form load time, and replace
control references with array references? Is that how VB6 compatibility
does it?

How do other people handle control arrays in .Net

Thanks!
 
H

Herfried K. Wagner [MVP]

Greg Lesnie said:
I guess VB6 compatibility creates a run-time array of controls with
related type and names - am I right?

So do I need to create a Control object array at form load time, and
replace control references with array references? Is that how VB6
compatibility does it?

In addition to the other replies:

Accessing controls by their names or indices
<URL:http://dotnet.mvps.org/dotnet/faqs/?id=controlbynameindex&lang=en>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top