Hi!
Just lost my mind today... :eek:
How do we attach an event handler to controls which are added dynamically through Controls Collection... .. :sick:
Printable View
Hi!
Just lost my mind today... :eek:
How do we attach an event handler to controls which are added dynamically through Controls Collection... .. :sick:
You mean like using the ...
In the General Declarations section.VB Code:
Public WithEvents SomeObject As ThatObject
not exactly...Quote:
Originally Posted by RobDog888
i don't know how many controls are added at runtime...
Well you could make them a control array. One procedure for each type of control. Then you can use the UBound and
Index to determine how many?
Hi,
This thread may be of interest -
Dynamic event handling
No Control arrays.. :( i don't want to create one control for every type in design time...Quote:
Originally Posted by RobDog888
Thanx Rob...Quote:
Originally Posted by RobCrombie
but this wudn't be suitable for me.. as i never know. which type of control is being added at run time... type is also decided on the fly. so i cannot declare with WithEvents... because WithEvents requires the type..