PC Review Forums Newsgroups Microsoft DotNet Microsoft Dot NET Framework Forms Passing mouse events up to a control's container

Reply

Passing mouse events up to a control's container

 
Thread Tools Rate Thread
Old 10-02-2006, 11:56 AM   #1
JezB
Guest
 
Posts: n/a
Default Passing mouse events up to a control's container


I want to handle events in a container (eg. MouseMove in a Panel). Problem
is: when the panel contains Controls and the mouse moves over that control,
MouseMove is no longer fired in the container. How can I force this?


  Reply With Quote
Old 10-02-2006, 01:50 PM   #2
Charles Law
Guest
 
Posts: n/a
Default Re: Passing mouse events up to a control's container

In the container, handle the mouse events you want to bubble, and raise
[your own] container events to repeat them up to the container's parent.

HTH

Charles


"JezB" <jezbroadsword@blueyonder.co.uk> wrote in message
news:%23WrunjjLGHA.3960@TK2MSFTNGP09.phx.gbl...
>I want to handle events in a container (eg. MouseMove in a Panel). Problem
>is: when the panel contains Controls and the mouse moves over that control,
>MouseMove is no longer fired in the container. How can I force this?
>



  Reply With Quote
Old 10-02-2006, 02:27 PM   #3
Stoitcho Goutsev \(100\)
Guest
 
Posts: n/a
Default Re: Passing mouse events up to a control's container

Charles, In windows forms there is no event bubbling. You need to catch
mouse events one each control that the contianer contains.


--

Stoitcho Goutsev (100)

"Charles Law" <blank@nowhere.com> wrote in message
news:OoUqwjkLGHA.2124@TK2MSFTNGP14.phx.gbl...
> In the container, handle the mouse events you want to bubble, and raise
> [your own] container events to repeat them up to the container's parent.
>
> HTH
>
> Charles
>
>
> "JezB" <jezbroadsword@blueyonder.co.uk> wrote in message
> news:%23WrunjjLGHA.3960@TK2MSFTNGP09.phx.gbl...
>>I want to handle events in a container (eg. MouseMove in a Panel). Problem
>>is: when the panel contains Controls and the mouse moves over that
>>control, MouseMove is no longer fired in the container. How can I force
>>this?
>>

>
>



  Reply With Quote
Old 10-02-2006, 07:02 PM   #4
Charles Law
Guest
 
Posts: n/a
Default Re: Passing mouse events up to a control's container

I used the word 'bubbling' because that is the effect that is being sought,
not because there is an intrinsic ability to bubble events. The solution is
still the same though: in each container, handle the desired events of the
child control and raise user-defined events in the container to be caught by
the parent.

Charles


"Stoitcho Goutsev (100)" <100@100.com> wrote in message
news:ub2Et2kLGHA.3100@tk2msftngp13.phx.gbl...
> Charles, In windows forms there is no event bubbling. You need to catch
> mouse events one each control that the contianer contains.
>
>
> --
>
> Stoitcho Goutsev (100)
>
> "Charles Law" <blank@nowhere.com> wrote in message
> news:OoUqwjkLGHA.2124@TK2MSFTNGP14.phx.gbl...
>> In the container, handle the mouse events you want to bubble, and raise
>> [your own] container events to repeat them up to the container's parent.
>>
>> HTH
>>
>> Charles
>>
>>
>> "JezB" <jezbroadsword@blueyonder.co.uk> wrote in message
>> news:%23WrunjjLGHA.3960@TK2MSFTNGP09.phx.gbl...
>>>I want to handle events in a container (eg. MouseMove in a Panel).
>>>Problem is: when the panel contains Controls and the mouse moves over
>>>that control, MouseMove is no longer fired in the container. How can I
>>>force this?
>>>

>>
>>

>
>



  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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off