Capturing Mouse events oiutside a control

  • Thread starter Thread starter HaySeed
  • Start date Start date
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?
 
try by using a method on the events of the childs that activate some event
on the parent control

hope this helps, Carlos.
 
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?
 
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?
 
Back
Top