Raise event problem

A

Andrew

I have a vb.net 2005 app I am creating, I also have a separate user control
that I have created separate from the app.

On the control I have:

Namespace HLMultiSelect.Forms.Controls
Public Class HLMultiSelect

Inherits System.Windows.Forms.Control

Public Event ReportMouseStatus(ByVal bStatus As Boolean)

Private Sub HLSelectButton_MouseEnter(ByVal sender As Object, ByVal
e As System.EventArgs) Handles Me.MouseEnter
mMouseHover = True
Invalidate()

RaiseEvent ReportMouseStatus(True)

End Sub

Private Sub HLSelectButton_MouseLeave(ByVal sender As Object, ByVal
e As System.EventArgs) Handles Me.MouseLeave

mMouseHover = False
Invalidate()

RaiseEvent ReportMouseStatus(False)
End Sub

End Class

End Namespace

On the app that I am creating I have:

Imports HLMultiSelect.Forms.Controls
Public Class Form1

Public WithEvents sMouse As New HLMultiSelect
Private Sub sMouse_ReportMouseStatus(ByVal bStatus As Boolean) Handles
sMouse.ReportMouseStatus

MsgBox("hello")

End Sub

Id does not fire, am I missing something?

The only thing that calls the event is when the user puts the mouse over the
control.
 
A

Andrew

It is a control on a form, but I was able to solve the problem, I did not
make the Public Event ReportMouseStatus(ByVal bStatus As Boolean)
A shared event.

Thanks for the help..
 

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

Similar Threads


Top