Jump to content

Control array

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Ankesh Kumar(Hack On) (talk | contribs) at 03:48, 21 January 2010 (Created page with ''''Control Array''' (mostly used in Visual Basic) is the collection of controls that programmer put it in form(VB Form).Control array is always single dimensional a...'). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

Control Array (mostly used in Visual Basic) is the collection of controls that programmer put it in form(VB Form).Control array is always 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.


Two ways to create a control array:Italic text

1. Create a control with desired properties. Copy the control and then paste it on the form. Visual Basic will show a message box that will ask you if you want to create a control array or not.Reply it with yes and the control array is created.

2. Create all the controls you want to create control array with desired Properties. Then, create another control with the same name. Visual Basic will show a message box that will ask you if you want to create a control array or not.Reply it with yes and the control array is created. Once the control array is created, rename all desired controls with the same name.