Home > Articles

You Can TOO Have Control Arrays in Visual Basic .NET!

  • Print
  • + Share This
Other programmers may tell you that Visual Basic .NET doesn't support control arrays, but look a little deeper and you'll find a technique that you really need to add to your programming toolkit.
Like this article? We recommend

Like this article? We recommend

While perusing an Internet forum for Visual Basic .NET (VBN from now on), I recently came across a thread that asked how to use control arrays in VBN. About a dozen replies stated that, unlike VB 6.0, VBN doesn't support control arrays.

Really? Aw, man! Now I have to go back and erase all the VBN code I've written that does use control arrays.

A lot of people really believe that VBN doesn't support control arrays. Perhaps this is understandable, because the VBN online help states the following under the topic "Control Array Changes in Visual Basic .NET":

In Visual Basic .NET, control arrays are no longer supported. Changes to the event model make control arrays unnecessary.

If you read a little further, however, you'll find that most of this statement is taken back in other parts of the online help dealing with control arrays. Come on...do you really think the people in Redmond would remove such a useful element from the language? They're too bright to leave us high and dry like that. Now that you're convinced, let me show you how to use controls arrays in VBN.

  • + Share This
  • 🔖 Save To Your Account