• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 179
  • Last Modified:

looping through controls

The following code does not sem to work

 Dim iObj As Control
 
 For Each iObj In Me.Controls
  If iObj.Tag = "hidden" Then
        iObj.Visible = False
  End If
 Next


in each controls tag I place the word "hidden". The controls will consist of labels, textboxes and pictureboxes.
0
dwe0608
Asked:
dwe0608
  • 2
1 Solution
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
>The following code does not sem to work

did you debug through it?
what does it do?

Dim iObj As Control
 
 For Each iObj In Me.Controls
  debug.print iObj.Name
  If iObj.Tag = "hidden" Then
        iObj.Visible = False
  End If
 Next

does this list the Controls?



0
 
dwe0608Author Commented:
AngelIII, yes, but its a long list ... I have the controls in an array (for each type of control).

pft ... I had misspelled "hidden" - only had one "d" and well what a time waster this has been ....

answer this query for the points ....

If I wanted to store the names of each control in an ini file - including its index, how would I do that ? I could then retrieve it later and then make the controls either hidden or visible depending on the value contained in the ini file ?
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now