I got a control array (shape one) now how do I clear the whole thing? there are 15 of those shapes
Printable View
I got a control array (shape one) now how do I clear the whole thing? there are 15 of those shapes
What do you mean, "clear"? You mean, not visible?
Code:For i = 0 to 15
Shape1(i).Visible = False
Next
yea and I also have an array of labels, do I do the same thing, but make it .caption = "" instead of .visible = false
P.S. I was thinking of a label when I was posting it (becuase I need it for a label and a shape) thats why I wrote clear
If you mean unload it works like this.
Code:Private Sub Command2_Click()
Dim intcre As Integer
'you always leave the index(0) of an array loaded
For intcre = 1 To 14
Unload Shape1(intcre)
Next intcre
End Sub
Same thing, isn't very hard:
You can also do it this way:Code:For i = 0 to 15
Label1(i).Caption = ""
Next
Code:For Each MyControl In Me.Controls
If TypeOf MyControl Is Label Then MyControl.Caption = ""
Next