473,386 Members | 1,828 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,386 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 10487
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: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.