Handle MouseWheel Without giving control Focus?
-
I have a Custom Control Listbox L1 and a panel P1. I need to handle Mouse Wheel movement on Panel P1 without giving it focus. I cannot use MouseWheel Event as it fires ONLY when the underlying control has focus. Any suggestions? Sukhjinder
-
I have a Custom Control Listbox L1 and a panel P1. I need to handle Mouse Wheel movement on Panel P1 without giving it focus. I cannot use MouseWheel Event as it fires ONLY when the underlying control has focus. Any suggestions? Sukhjinder
I guess you need to catch the event where you have focus and pass it to your control.
Christian Graus - Microsoft MVP - C++ "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
-
I guess you need to catch the event where you have focus and pass it to your control.
Christian Graus - Microsoft MVP - C++ "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
Hi, One of my controls is a Custom ListBox L1 which handles MouseWheel Events for itself so I cannot intercept its mouse wheel events and use it. Also this does not look & feel elegant. Also I have few Push Buttons and I dont want to handle their mouse wheel events...
-
Hi, One of my controls is a Custom ListBox L1 which handles MouseWheel Events for itself so I cannot intercept its mouse wheel events and use it. Also this does not look & feel elegant. Also I have few Push Buttons and I dont want to handle their mouse wheel events...
Well, if mouse wheel events only get sent to the control that has the focus ( as all mouse events do ), the only other solution I can think of is if there's an API you can call to get the wheel pos, on a timer. That's not elegant, it's ugly. And, I don't think it works, from memory, the mouse wheel events pass a number that tells you the direction the mouse moved in and how fast, not a number that defines a finite position.
Christian Graus - Microsoft MVP - C++ "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )