[AccessD] Building a ListView control class?

philippe pons phpons at gmail.com
Thu Mar 5 13:30:27 CST 2009


Hi all,

Following John W. Colby lectures on classes (thank's to him once again), I
tried to build one for a ListView control.
It's an ActiveX that resides within the mscomctl.ocx.

I déclared a clsListView.
In the header of the class I declared:

Private WithEvents mctlListView As MSComctlLib.Listview
Private Const cstrEvProc As String = "[Event Procedure]"

NB: omitting the name of the class:MSComctlLib leads to an error msg when
compiling.

Then the init function:

Function mInit(lctlListView As ComboBox)
    ' stores a pointer to the control
    Set mctlListView = lctlListView
    ' affecte la chaine [Event Procedure] aux propriétés événementielles
    mctlListView.OnClick = cstrEvProc
'    mctlListView.ondbkclick = cstrEvProc
End Function

The problem is that the OnClick property gives a compile error!
The ListView control has an Click event, but no OnClick property.

If you look at the ListView control in the object brower, it appears that it
has no event property, just events!

I'm afraid it will not be easy to use a class control for this control and
be able to sink events, what is what I need to do.

Any tricks, brothers?

Regards,

Philippe



More information about the AccessD mailing list