svenkatapuram
asked on
passing name of control Array to a Routine
I need to pass a name of controlArray to a Routine, so that i do not have to repeat the code every time i am using to set some of the controlArray properties
Whe i tried to do this i am getting an error message "Invalide property Assignemnet"
My code looks like this:
This is my control Array click event:
Private sub lblTemp_Click(Index as Integer)
DoSomething lblTemp, Index
End Sub
This is the routine where i want to pass the control array name:
Private Sub Procedure DoSomething(lblLabel as Label, _
idx as Integer)
lblLabel(idx).caption = "Hello World"
End Sub
Whe i tried to do this i am getting an error message "Invalide property Assignemnet"
My code looks like this:
This is my control Array click event:
Private sub lblTemp_Click(Index as Integer)
DoSomething lblTemp, Index
End Sub
This is the routine where i want to pass the control array name:
Private Sub Procedure DoSomething(lblLabel as Label, _
idx as Integer)
lblLabel(idx).caption = "Hello World"
End Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Have you tried defining
DoSomething(lblLabel as Object, ....
and/or calling the application by using
DoSomething lblTemp(Index), Index
DoSomething(lblLabel as Object, ....
and/or calling the application by using
DoSomething lblTemp(Index), Index
ASKER
Thanks,
it did work
it did work
Private Sub lblTemp_Click(Index As Integer)
DoSomething lbltemp(Index)
End Sub
Private Sub DoSomething(lblLabel As Label)
lblLabel.Caption = "Hello World"
End Sub
you have to pass the label with its index because just the label name refers to no specific label