472,351 Members | 1,610 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

mouse events when the mouse is on a "child control"

red
mouse events when the mouse is on a "child control"

hi everyone;
my problem:
I have a userControl
in this usercontrol, I have a child control (a button)

when the mouse moves over the userControl, I can detect the movement using
MouseMove event.
the problem is when the mouse is on the child control : I can t detect
anything when the mouse move. userControl don t recieve the MouseMove event.

I did many search on this problem, but solutions I found are not elegant:
1- using hooks (not a part of .net platform)
2- the child control report the mouse movement to the parent control (the
userControl here)

please, can u explain me how to solve this problem?
thnks

n.b.: sorry for my english
Jul 27 '05 #1
3 10143
System always gives the previlage to listen mouse events to the last
entered control. For windows forms as you know there is a property
KeyPreview which enables Forms to receive mouse events before the
contained controls. If you make the user control listen the mouse
events; then user control can handle the mouse move. For instance, if
you press the mouse button when the mouse is on the uc, and start to
move you will see that uc is receiving mouse move events even if the
mouse is over the child control.
So you must manually mouse event listening previlage to the uc like
mouse down automatically does it for you.

Jul 28 '05 #2
how can I manually handle mouse event previlage?
thnks for ur answer
"dincerozturan" <di************@bizitek.com.tr> wrote in message
news:11********************@f14g2000cwb.googlegrou ps.com...
System always gives the previlage to listen mouse events to the last
entered control. For windows forms as you know there is a property
KeyPreview which enables Forms to receive mouse events before the
contained controls. If you make the user control listen the mouse
events; then user control can handle the mouse move. For instance, if
you press the mouse button when the mouse is on the uc, and start to
move you will see that uc is receiving mouse move events even if the
mouse is over the child control.
So you must manually mouse event listening previlage to the uc like
mouse down automatically does it for you.

Jul 29 '05 #3
For instance in the UserControl's code window handle the mouse_enter
event and write
this.Capture = true;
You will see that mouse move is captured bu usercontrol even if the
mouse is on the child control.

Hope this helps..

Jul 29 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Jeff_F | last post by:
Hi all. Question in two parts. I'm looking to add two combo boxes. The first will contain regions and the second will contain employee names...
0
by: Ravi Ambros Wallau | last post by:
Hi: I've created a custom control - a grid that uses Infragistics to display some filters, the grid itself, and some buttons. Well, when using...
8
by: Ravi Ambros Wallau | last post by:
Hey guys: What can I do when an "Error Creating Control" is displayed on the form (instead of the control), and a tooltip indicating the error...
3
by: red | last post by:
mouse events when the mouse is on a "child control" hi everyone; my problem: I have a userControl in this usercontrol, I have a child control...
2
by: Joe HM | last post by:
Hello - I have an application with which I am trying to determine whether another application has a "child" window open. So I used...
3
by: rlueneberg | last post by:
I want to change the color of an "a" child element inside a table cell via javascript. Is there any way to do that? Ps: there is no id assigned to...
1
by: hartattack72 | last post by:
Hello. I am new to access, but have had great success in creating an application. My one user is requesting a function to save time in data...
1
by: rmgalante | last post by:
I was wondering if anyone knows whether MS has a fix for the Menu Control. If the page is loading while you mouse over a menu control with child...
1
by: jaffarkazi | last post by:
Hi, I have a .ascx control which holds company information which can be edited. One of the controls inside this is an Address control. The address...
0
better678
by: better678 | last post by:
Question: Discuss your understanding of the Java platform. Is the statement "Java is interpreted" correct? Answer: Java is an object-oriented...
0
by: teenabhardwaj | last post by:
How would one discover a valid source for learning news, comfort, and help for engineering designs? Covering through piles of books takes a lot of...
1
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...
0
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand....

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.