By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,815 Members | 1,066 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,815 IT Pros & Developers. It's quick & easy.

Passing on a raised event

P: n/a
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

Nov 20 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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

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

" Just Me" <ne********@a-znet.com> wrote in message
news:Oy**************@TK2MSFTNGP09.phx.gbl...
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


Nov 20 '05 #2

P: n/a
Ken, Thanks again

"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:%2***************@TK2MSFTNGP11.phx.gbl...
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

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

" Just Me" <ne********@a-znet.com> wrote in message
news:Oy**************@TK2MSFTNGP09.phx.gbl...
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

Nov 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.