Implement VB5/6 Style Control Arrays In VB.NET

Category:
C#, VB.NET, ASP.NET
Type:
Classes
Difficulty:
Intermediate

Author: Anonymous

Version Compatibility: Visual Basic.NET

More information:
VB.NET unfortunately does not support control arrays like good old VB5 and 6 did. However, due to advancements made in VB.NET, you can fake it with relative ease. Here is a class that will act like a Button array, but it can be modified to work for other types of controls. Also, I've implemented the more popular Button events, and it's fairly simple to add or remove events as needed.

Instructions: Copy the declarations and code below and paste directly into your VB project.

Declarations:

Code: