by John Flaherty (5 Submissions)
Category: Custom Controls/Forms/Menus
Compatability: Visual Basic 5.0
Difficulty: Unknown Difficulty
Originally Published: Fri 9th November 2001
Date Added: Mon 8th February 2021
Rating: (1 Votes)
Put all types of controls into a single array...EVEN ARRAYS ALREADY IN A CONTROL ARRAY. I use this type of array with a boolean array to
Dim MyArray(0 To 5) As Control
'Test to see if the Array element will respond to the controls visible property
'NOTE: all the controls in your array must have the .visible property. You'll
'see below that I only used combo boxes, text boxes, labels, lines and
'command buttons. You'll note I placed two labels in a control array before
'placing them into the array, MyArray.
Private Sub Command1_Click()
MyArray(5).Visible = False
End Sub
'Load the controls using the keyword "Set"
Private Sub Form_Load()
Set MyArray(0) = Label1(0)
Set MyArray(1) = Label1(1)
Set MyArray(2) = Text1
Set MyArray(3) = Combo1
Set MyArray(4) = Command1
Set MyArray(5) = Line1
End Sub
No comments have been posted about Put all types of controls into a single array...EVEN ARRAYS ALREADY IN A CONTROL ARRAY. I use this . Why not be the first to post a comment about Put all types of controls into a single array...EVEN ARRAYS ALREADY IN A CONTROL ARRAY. I use this .