Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I scroll my panel using my mousewheel?

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.

like image 719
Sergio Tapia Avatar asked Oct 21 '09 12:10

Sergio Tapia


People also ask

How do I scroll with mouse movement?

You might see a small wheel on your mouse, located between the left and right mouse buttons. This is what is known as the scroll wheel. The scroll wheel can be rotated by your index finger and used to move up and down a document or a webpage.

How do I enable scroll click?

Many mice and some touchpads have a middle mouse button. On a mouse with a scroll wheel, you can usually press directly down on the scroll wheel to middle-click. If you don't have a middle mouse button, you can press the left and right mouse buttons at the same time to middle-click.


1 Answers

What worked for me was adding panel1_MouseEnter EventHandler:

private void panel1_MouseEnter(object sender, EventArgs e) {     panel1.Focus(); } 
like image 182
beam022 Avatar answered Sep 22 '22 05:09

beam022