Passing mouse events up to a control's container

J

JezB

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?
 
C

Charles Law

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
 
S

Stoitcho Goutsev \(100\)

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 said:
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 said:
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?
 
C

Charles Law

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) said:
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 said:
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 said:
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?
 

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