473,320 Members | 1,859 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Passing on a raised event

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
2 1644
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: nmueggler | last post by:
Hi I'm working on a Word 2003 mail merge component for a windows client. My problem is that the BeforePrint Event ist not raised if the user is printing directly out of word, but if I'm running...
4
by: Stijn Goris | last post by:
Hi all, I place a usercontrol (2) on another usercontrol (1). The second usercontrol has a button. Is there a way usercontrol (1) can know when the button is clicked on usercontrol (2) without...
3
by: Solel Software | last post by:
Hi, I have a user control embedded in another user control that is embedded in a web form Page.aspx < Module.ascx < ProblemHere.ascx In ProblemHere.ascx I have a regular <asp:Button and a ...
6
by: Max | last post by:
Last time I tried to explain this on another forum it didn't go too well, so I'll try my best and if you know what I'm talking about then please tell me how to do this. I have a class, inside I...
7
by: AMP | last post by:
Hello, I have this in form1: namespace Pass { public partial class Form1 : Form { public Form2 form2; public Form1() {
0
by: simplediscourse | last post by:
i'm trying to demonstrate timeslicing among equal high priority threads without putting threads to sleep. to do this i'm trying to run a timer while executing a very long loop sequence in order to...
2
by: Karch | last post by:
I have an event that is not being raised on postback from client script. It DOES get raised during a "normal" postback. The event is wired up in the Page Init. I have traced through and my event...
6
by: Tom | last post by:
This is probably a really basic question, but I know someone will be able to help me. I have a single object A that contains a hash of objects B. Each object B contains its own TCP client object...
8
by: =?Utf-8?B?bWljaGFlbCBzb3JlbnM=?= | last post by:
I created a user control that handles certain keystrokes, e.g. Ctrl-C for cut, Ctrl-V for paste, plus other more specialized keystrokes. I want to list these in the menubar like any other menu...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.