Passing mouse events up to a control's container

  • Thread starter Thread starter JezB
  • Start date Start date
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?
 
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
 
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?
 
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?
 
Back
Top