Control Arrays:

A control array is a group of controls that share the same Name, type, and event procedures. Acontrol array has at least one element and can grow to as many as elements as your systemresources and memory permit, and the size also depends on how much memory and Windowsresources each control requires. Elements of the same control array have their own propertysettings. Common uses for control arrays include Menu controls and groups of OptionButtoncontrols.Control arrays are useful if you want several controls to share code. For example, if you createthree OptionButton controls as a control array, the same code executes regardless of whichbutton receives the Click event.Eg. as the following code showsPrivate Sub optButton_Click(Index As Integer)' Index indicates the control that was clicked in the control array.picDisplay.BackColor = QBColor(Index + 1)End Sub

No comments:

Post a Comment