Passing on a raised event

  • Thread starter Thread starter Just Me
  • Start date Start date
J

Just Me

A control on a UserControl has it's mouseup event raised.

I want the usercontrol to pass it on.

That is , I want the form containing the UserControl to receive a MouseUp
event from the UserControl.


Do I have to define an event in the user control and raise it in the
controls MouseUp event, or is there a neater way?

If I have to define an event, can I call it MouseUp?


Thanks
 
Hi,

You have to shadow the event and raise it manually. This example
will raise the mousemove event when the mouse moves over a textbox in the
user control.

Public Shadows Event MouseMove(ByVal sender As Object, ByVal e As
MouseEventArgs)



Private Sub TextBox1_MouseMove(ByVal sender As Object, ByVal e As
System.Windows.Forms.MouseEventArgs) Handles TextBox1.MouseMove

RaiseEvent MouseMove(sender, e)

End Sub



Ken

-----------------------

A control on a UserControl has it's mouseup event raised.

I want the usercontrol to pass it on.

That is , I want the form containing the UserControl to receive a MouseUp
event from the UserControl.


Do I have to define an event in the user control and raise it in the
controls MouseUp event, or is there a neater way?

If I have to define an event, can I call it MouseUp?


Thanks
 
Back
Top