Mouse Scroll Event in C#

private void Form_Load(object sender, EventArgs e)
{

this.MouseWheel += new MouseEventHandler(pictureBox1_MouseWheel); //Create Mouse Scroll Event at Form Load.

}
void pictureBox1_MouseWheel(object sender, MouseEventArgs e)
{

try
{

if(e.Delta>0) //Scroll UP Event
{

BtnNext.PerformClick(); //Call Your Method.

}
else//Scroll DOWNEvent
{

BtnPrev.PerformClick();//Call Your Method.

}

}
catch (Exception se)
{}

}

Write a Comment

Your email address will not be published. Required fields are marked *