Events with diniamically added controls

F

fernando

Hi,

I have an application in VBA were I dinamically add several controls to a
form. Im creating arrays of variables of type Control to access the added
controls, for ex:

Set ctrl_graph(i) = page_id.Controls.Add(add_chkbox_string, "ctrl_graph" & i)

Now I need to add events to this controls, but I have encountered that
'WithEvents' doesnt work with arrays. How can I add events to this controls?

Greetings
Fernando
 
F

fernando

Tom,

This code works fine, but only with comboboxes, im using also textboxes and
checkboxes, if I define in the class module this:

Public WithEvents ctrl As CheckBox

I get "the object doesnt have automation events", hope the translation is ok.

fernando
 
F

fernando

can the controls events, props and methods be 'inherited'?, for ex. top,
caption, setfocus, etc.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top