I have a panel on my form with AutoScroll set to true so a scrollbar appears automatically.
How can I make it so a user can use his mouse wheel to scroll the panel? Thanks SO.
I have a panel on my form with AutoScroll set to true so a scrollbar appears automatically.
How can I make it so a user can use his mouse wheel to scroll the panel? Thanks SO.
Moving the scroll wheel should trigger the control's MouseMove event. The MouseEventArgs argument has a property named Delta, which gives the (signed) number of notches that the mouse wheel has moved. You can use this property to scroll the panel.
I am using a windows form with BorderStyle set to none, where I use a panel to have all my controls in, so it looks nice (color difference and such..) was having the same issue while I had other forms that worked fine.
What did I forgot:
DoubleBuffered is magical I noticed..
Make sure that your panel has focus. And this is simple code to scroll your panel scrollbar. Hope this help. :) enter code here
The panel or a control in the panel must have focus. Note that if the control with focus has scroll bars, it will scroll instead of the panel.
What worked for me was adding
panel1_MouseEnter
EventHandler:In the designer file, you can add the following line of code. the MouseWheel event is not doumented in Events list in the Properties window.
Panel1_MouseWheel will be triggered when you roll the mouse weel
Add the code in the .cs file