473,324 Members | 2,248 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,324 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 10465
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 which correspond to the region selected in the first...
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 this control directly on WebForm, everything works...
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 never is displayed? Is there some log, some hidden...
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 (a button) when the mouse moves over the...
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 Process.MainWindowTitle() but that will only give me the main...
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 child elements. I would like to discover the child...
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 entry... and I am stumped being the plebian that I am. ...
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 menus that pop out, you can generate the following...
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 control has country and state dropdowns loaded....
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
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
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: 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.