Access VBA Withevents on CustomControl

R

ryanmhuc

I'm curious how to trap an event on a CustomControl on a Form from
another class. For example I would like to trap an event on the
Microsoft ListView Control (Version 6) (MSComctlLib.ListView).

When placed on the form the ListView control is of type CustomControl
and the object propety is of type MSComctlLib.ListView. From this
control on the form you can trap any event (ex: ListView3_click). But I
would like to trap the event in another class (class Exam). The class
has a variable decalared as

Public oCC withevents as CustomControl

But when I set the CustomControl (ListView3) on my form to the new
class (Exam) I get a runtime error 459 "Object or class does not
support the set of events". Yet you can trap the events from this
object just fine on the Form it resides on. What gives?
 

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