PC Review


Reply
Thread Tools Rate Thread

Capturing Mouse events oiutside a control

 
 
HaySeed
Guest
Posts: n/a
 
      7th Nov 2008
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?

 
Reply With Quote
 
 
 
 
xcal
Guest
Posts: n/a
 
      20th Nov 2008
try by using a method on the events of the childs that activate some event
on the parent control

hope this helps, Carlos.

"HaySeed" <(E-Mail Removed)> escribió en el mensaje
news:172F2A74-3730-4AB2-8DA9-(E-Mail Removed)...
>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?
>



 
Reply With Quote
 
HaySeed
Guest
Posts: n/a
 
      22nd Nov 2008
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?


"xcal" wrote:

> try by using a method on the events of the childs that activate some event
> on the parent control
>
> hope this helps, Carlos.
>
> "HaySeed" <(E-Mail Removed)> escribió en el mensaje
> news:172F2A74-3730-4AB2-8DA9-(E-Mail Removed)...
> >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?
> >

>
>
>

 
Reply With Quote
 
Jack Jackson
Guest
Posts: n/a
 
      23rd Nov 2008
Yes. Look at Application.AddMessageFilter.

On Sat, 22 Nov 2008 11:12:00 -0800, HaySeed
<(E-Mail Removed)> wrote:

>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?
>
>
>"xcal" wrote:
>
>> try by using a method on the events of the childs that activate some event
>> on the parent control
>>
>> hope this helps, Carlos.
>>
>> "HaySeed" <(E-Mail Removed)> escribió en el mensaje
>> news:172F2A74-3730-4AB2-8DA9-(E-Mail Removed)...
>> >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?
>> >

>>
>>
>>

 
Reply With Quote
 
HaySeed
Guest
Posts: n/a
 
      3rd Dec 2008
Thanks Jack

"Jack Jackson" wrote:

> Yes. Look at Application.AddMessageFilter.
>
> On Sat, 22 Nov 2008 11:12:00 -0800, HaySeed
> <(E-Mail Removed)> wrote:
>
> >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?
> >
> >
> >"xcal" wrote:
> >
> >> try by using a method on the events of the childs that activate some event
> >> on the parent control
> >>
> >> hope this helps, Carlos.
> >>
> >> "HaySeed" <(E-Mail Removed)> escribió en el mensaje
> >> news:172F2A74-3730-4AB2-8DA9-(E-Mail Removed)...
> >> >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?
> >> >
> >>
> >>
> >>

>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Capturing mouse events (Mouse up and down on the desktop) Ahmed Microsoft VB .NET 6 8th Jun 2006 06:52 AM
Capturing mouse events (Mouse up and down on the desktop) Ahmed Microsoft Dot NET Framework Forms 0 6th Jun 2006 06:54 PM
Capturing mouse, key events Schemer Microsoft Dot NET Framework Forms 22 18th Aug 2005 02:50 AM
Capturing mouse wheel events Evgeny Zoldin Microsoft C# .NET 2 23rd Nov 2003 10:39 PM
Capturing mouse wheel events Evgeny Zoldin Microsoft Dot NET 2 23rd Nov 2003 10:39 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:08 PM.