I have a winform that has a Panel that covers the whole form. The panel is scrollable but will only scroll with the side scrollbars and not the mouse's scroll wheel.
Any idea's how to fix this?
Printable View
I have a winform that has a Panel that covers the whole form. The panel is scrollable but will only scroll with the side scrollbars and not the mouse's scroll wheel.
Any idea's how to fix this?
A control has to have focus to scroll with the mouse wheel. Given that a Panel cannot receive focus I'd say that you're out of luck. Controls like TextBoxes and ListBoxes will scroll with the mouse wheel no problem, but they can receive focus.
Your only option would be to handle the MouseWheel event for each control within the Panel and then try to translate that into scrolling the Panel itself, which you'd have to do in code yourself. Note though that for controls that react to scroll events themselves you probably shouldn't scroll the Panel.
Thanks for your advice jmcilhinney. I managed to get around it by having a tiny blank label on the panel and giving it focus on form load.