Variable to Event sub

enonod

Well-Known Member
Licensed User
Longtime User
Is there ANY way please, (devious or otherwise), other than using a global variable, of passing a parameter/variable to an Event sub such as Button_Click?
 

enonod

Well-Known Member
Licensed User
Longtime User
Many thanks agraham. That will save using a whole load of globals.
 
Upvote 0

enonod

Well-Known Member
Licensed User
Longtime User
Sorry but I was a bit too quick replying. A question arises.
I have made a keyboard from labels. The common Click event, (using sender), requires the array of labels for a process. Because the array is declared in the main sub and not visible in its click sub, I can as you suggest pass it via the tag. However, not knowing (psychically) which key will be pressed, means that the tag of every label needs to have this array attached.
Do I need to worry about resources? (I don't want to use global as stated).
I visualise 30 copies of the array attached to the labels that form that array.
Is there in fact only actually an address attached and thus only a minor overhead?
 
Upvote 0

enonod

Well-Known Member
Licensed User
Longtime User
Grateful thanks.
 
Upvote 0

enonod

Well-Known Member
Licensed User
Longtime User
Wow, there is a free lunch :)
Thank you agraham
 
Upvote 0
Top