Capturing Mouse events oiutside a control


H

HaySeed

I have a Win Form Control that Contains several child controls. These
children can be "Selected" by the user at run time to "Activate" them.
Holding down the control key will allow the user to activate multiple
controls at once. I need to deactivate these controls when a user clicks
anywhere off of them. This is easy to do when a user clicks inside the
parent control, but when the control is dropped on a form I need to deselect
my active children when the mouse down event occurs anywhere on the form.

How do I create a listener within the parent control that can capture mouse
events once a child control has been made active?
 
Ad

Advertisements

X

xcal

try by using a method on the events of the childs that activate some event
on the parent control

hope this helps, Carlos.
 
H

HaySeed

Let me clarrify - Suppose you wrote a component that was a to be dropped on a
form which was outside of your control. You would like your component to
have the behavior described below. Is there a way for your component to
subscribe or capture all mouse events (inside or outside the component's
Client Rect) and respond accordingly?
 
J

Jack Jackson

Yes. Look at Application.AddMessageFilter.

Let me clarrify - Suppose you wrote a component that was a to be dropped on a
form which was outside of your control. You would like your component to
have the behavior described below. Is there a way for your component to
subscribe or capture all mouse events (inside or outside the component's
Client Rect) and respond accordingly?
 
Ad

Advertisements


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top