|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
object does not source automation errorhi,
i'm trying to get my image object (clsBitmap) to respond to events, such as mouseover events, mouseclick events etc I declared my image object : dim WithEvents cbImg as clsBitmap and in the form_load() sub: set cbSkype = new clsBitmap when I compiled it I got this error message: Compile error:object does not source automation events How can I get this thing correct? Pls show me the way. Thanks That error is raised when you define your class 'withevents' but it
does not raise any events. Here's a simple class with events & form implementation 'Class1 Option Explicit Private WithEvents mpb As PictureBox Public Event PBClick() Private Sub mpb_Click() RaiseEvent PBClick End Sub Public Property Set PBox(pb As PictureBox) Set mpb = pb End Property 'Form1 Option Explicit Private WithEvents C As Class1 Private Sub C_PBClick() Debug.Print "pb click" End Sub Private Sub Form_Load() Set C = New Class1 Set C.PBox = Picture1 End Sub Show quoteHide quote "adzir" <muad***@yahoo.com> wrote in message news:1142763389.616012.317920@v46g2000cwv.googlegroups.com... > hi, > > i'm trying to get my image object (clsBitmap) to respond to events, > such as mouseover events, mouseclick events etc > > I declared my image object : > > dim WithEvents cbImg as clsBitmap > > and in the form_load() sub: > > set cbSkype = new clsBitmap > > when I compiled it I got this error message: > > Compile error:object does not source automation events > > How can I get this thing correct? Pls show me the way. Thanks >
keycodes
Find most similar filename Timer to start my program at a certain time? Finding child? windows Retval - Shell program run problem with parameters Sending Email with VB DAO Control Find Method VB6 keeps asking for VisualStudio 2005 DVD VB making a CSV from a filename Filling TreeView from directory |
|||||||||||||||||||||||