If you can’t see the “MouseWheel” event on a component, then you need to create it manually. Also, we need to focus that component, otherwise the “MouseWheel” event will not work for that component. I will show you how to create a “MouseWheel” event for “pictureBox1” and how it works.
-
INSIDE THE CONSTRUCTOR, create a mousewheel event on that component.
InitializeComponent(); this.pictureBox1.MouseWheel += pictureBox1_MouseWheel;
-
CREATE THE FUNCTION manually. According to my example, call it “pictureBox1_MouseWheel”
private void pictureBox1_MouseWheel(object sender, MouseEventArgs e) { //you can do anything here }
-
CREATE a MouseHover event on that component (Go to properties in PicureBox1, select event, locate “MouseHover” and double-click the “MouseHover” event).
-
CALL “Focus()”; method inside that MouseHover event.
pictureBox1.Focus();
-
Now run the program.