Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Labels in arrays

Status
Not open for further replies.

ndalli

Programmer
Nov 6, 1999
76
0
0
MT
Hi,

I am using arrays when creating Labels on a form. So all the labels in a form will have the name of lblMyLabel(n).

Now I need to loop through all the controls on the current forms and check their caption. The problem I am finding is that whilst the actual loop goes through all the controls, it would not extract the captions of lblMyLabel(n) since it will be 'asking' for lblMyLabel.caption which in actual fact does not exists.

Does anyone know how I can go about it? I am trying to keep the function is generic as possible, sincxe it has to be used by all the forms in the application.

Many thanks in advance.
 
Try:
lblMyLabel(n).Caption

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'People who live in windowed environments shouldn't cast pointers.'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top