|
-
Aug 23rd, 2000, 10:01 PM
#1
Thread Starter
Frenzied Member
I have a lot of labels (label1) and I made them all a label control array I also have shapes which I also made into a control array, I made sure that there is the same of both. my goal is to make it so that is label1(1).visible = false, then shape1(1).visible = false. but I dont want to write it out for every single label and shape so I tried this code and it did not work, whats wrong with is:
Code:
if label1(index as Integer).Visible = False then
shape1(index as Integer).Visible = False
End If
if the code is just stupid can someone please give me the correct
NXSupport - Your one-stop source for computer help
-
Aug 23rd, 2000, 10:08 PM
#2
Lively Member
assuming u have n labels and shapes
for index = 1 to n
shape1(index).visible = label1.visible
next index
it can be done more nicely with a for each loop, but i cant rem how at the moment
-
Aug 23rd, 2000, 10:13 PM
#3
Thread Starter
Frenzied Member
NXSupport - Your one-stop source for computer help
-
Aug 23rd, 2000, 10:24 PM
#4
Or you could do this:
Code:
Dim MyControl As Control
For Each MyControl In Me.Controls
If TypeOf MyControl Is Label Then MyControl.Visible = False
If TypeOf MyControl Is Shape Then MyControl.Visible = False
Next
-
Aug 23rd, 2000, 10:25 PM
#5
Thread Starter
Frenzied Member
thanks but the other one is a little shorter
NXSupport - Your one-stop source for computer help
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|