Mouse Wheel

  • Thread starter Thread starter Anders Eriksson
  • Start date Start date
A

Anders Eriksson

Hello!

I have a program with three views

------------------------------------
| | |
| 1 | 2 |
| | |
| |--------------------------|
| | |
| | 3 |
| | |
| | |
-------------------------------------

view 1 contains a TreeControl
view 2 contains a Listcontrol
View 3 contains a html-control

I want each control to react to the mouse wheel just by having the mouse
cursor in the control. At the moment I need to activate the control for the
mouse wheel to work.

How do I do this??

// Anders
 
Hi,

If I understand correctly you want that the action occur on the control
over which the mouse is located, what happen is that the event is sent to
the control with focus, if you want to change this you will have to redirect
the event to the correct control by checking over what control the mouse is
located , you can use the MouseEnter and MouseLeave events on each control
to know when the mouse is over them, you could have a member variable which
indicate the correct control, then use the same mousewheel handler for the
three controls, in this method you will have the correct control in the
member variable and you can do whatever you want.

Cheers,
 
Hi.

I tried to use the same tip you gave Anders here but got stuck. I created a
member variable that now identifies correctly over which control the mouse
is. I also wired the mousewheel event of each of my controls to use the same
eventhandler method.

This is where I got stuck now. How do I now redirect the mousewheel event
forward to one of my controls? The controls I have are treeview, listview,
listbox and a textbox. I want the mousewheel event to have the same effect
on the controls as they had before I interrupted the mousewheel event.

Hope my message makes sense.

Best regards.
 
Back
Top