Event tracking of controls created during run-time
Hi all,
I have some vb controls dynymically created during the form load, like this during the form_load:
set objCtl = controls.Add(strCtlNameVB, strCtlNameCtl)
In other word, I don't know the name, type of these controls when I design the form. How can I track the event for these controls, such as LostFocus? I tried to use Controls collection but no luck.
Thanks,
Joe
[email protected]
Re: Event tracking of controls created during run-time
You probably need to put this in a Class module.
There is a tutorial on
http://www.**************/
titled "CATCHING EVENTS OF DINAMICALY ADDED CONTROL ARRAYS" which discusses how to accomplish this but this tutorial has several flaws. It is doable however if you have enough programming experience to overcome them. (note the spelling of Dynamically in its title)
John G
Re: Event tracking of controls created during run-time
I was looking for it. I cannot test it right now, but I will do. Thanks for sharing, John.
Special thanks to Lothar "the Great" Haensler. Come back soon, you Guru.
Re: Event tracking of controls created during run-time
Thanks John, that was very helpful.