Login | Register   
RSS Feed
Download our iPhone app
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.


WinForms Controls—Creating Control Arrays in VB.NET : Page 2

One of the VB6 features that are no longer supported in VB.NET is the automated creation of control arrays by simply copying an existing control as many times as required into an array. There is existing literature in MSDN which illustrates how to create control arrays at run time, but this may not be a suitable approach in all cases. The approach illustrated in this article allows the developer to quickly and easily create control arrays within Form or User Controls, with design-time support.




Application Security Testing: An Integral Part of DevOps

The Windows Application Derived Classes

The primary aim of the derived classes is to extend the abstract base classes by implementing the abstract event handler methods. In addition they can contain any auxiliary methods called by the event handlers. In practice, the derived classes contain any application specific logic that we want to keep out of the abstract classes which thus remain fully generic.

Each derived class inherits from the corresponding abstract base class as follows:

Inherits libCtlArray.clsTxtArray

Each derived class contains one or two constructors, depending on which container controls are used in the client application.

e)     Constructor # 1 caters for controls located on Windows Forms

f)        Constructor # 2 caters for controls located on Windows User Control

In addition, the constructors contain three parameters to identify the array items

g)     Control Prefix string [eg. strText]

h)      Array identifier string [eg. strArr]

The derived class constructor instantiates the corresponding base class which, as we saw in the preceding section, populates the arrays.


Public Sub New(ByRef UserCtl As UserControl, ByVal strTxt As String,_

is a developer with 7 years of experience designing and programming applications in VB, VB.NET, ASP, SQL Server. He is currently working for a software house specialised in the development of B2B web applications. Reach Mauro at mauro@mpt-ltd.com.
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



Thanks for your registration, follow us on our social networks to keep up-to-date