Jump to content

Control array

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Enterprisey (talk | contribs) at 19:01, 12 February 2016 (add more wikilinks). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

In Visual Basic, a control array[1] is a group of related controls in a Visual Basic form that share the same event handlers. Control arrays are always a single-dimensional array. Control array is that you can add or delete array elements at run-time. With some controls, it is very useful to define control arrays - it depends on the application.

Control arrays are a convenient way to handle groups of controls that perform a similar function. All of the events available to the single control are still available to the array of controls, the only difference being an argument indicating the index of the selected array element is passed to the event. Hence, instead of writing individual procedures for each control (i.e. not using control arrays), you only have to write one procedure for each array.

References