PDA

Click to See Complete Forum and Search --> : Dynamic controls and their event handling


pdeutsc
Jan 31st, 2001, 02:24 PM
After dynamically creating a control during run time using VbControlExtender object, I can only access the events for the most recently created object in the ObjectEvent event.

Though it is probably impossible I am trying to find a way to code events for every control created dynamically.

Bill Crawley
Feb 1st, 2001, 09:56 AM
THe only way I can think of this is to create 1 of each regardless (It's a bit like when you place a single text box on a form then in code you may create a new text box on the form.) then as a new one is created create a control array of that type, then the new one will inherit all events of the original.

pdeutsc
Feb 1st, 2001, 10:08 AM
If I understand what you mean correctly, the difficulty is that vb will not allow me to create a control array at runtime, nor have I found a way to dynamically add to an existing control array.

If I am missing your point please let me know.
Thank you very much for your thoughts on the matter.

pdeutsc
Feb 1st, 2001, 01:15 PM
Forget about the VbControlExtender!
I forgot that you can dynamically instantiate
new controls that are already part of a control array
in design time.

Sub Whatever()
Load NewDamnControl(NewIndex)
End Sub

Geeze. it is so simple im sick!

tumblingdown
Feb 8th, 2001, 03:29 AM
yep, groovy isn't it ;-!


td.

pdeutsc
Feb 8th, 2001, 08:24 AM
yeah when applied to activex controls you can do some add some pretty awsome flexibility.