Click here to Skip to main content
15,888,113 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi,

i want to change the mouse cursor in to plus sign when the mouse scroll button is scrolled forward and mouse cursor into minus sign when the mouse scroll button is scrolled backward.

i am using visual studio 2008 for development.

first of all i want to know how can i get the mouse scroll event.
please guide me
Posted
Updated 1-Feb-12 23:24pm
v2

 
Share this answer
 
Comments
Sridhar Patnayak 2-Feb-12 1:34am    
Good link my 5+
try this code. i haven't tested it,but it should work

C#
//assuming u r working with window forms

//this would add mousewheel event
this.MouseWheel += new MouseEventHandler(CallMeOnMouseWheelUse);

void private CallMeOnMouseWheelUse(object sender, MouseEventArgs e)
{
            if (e.Delta > 0)
                {
                //mouse wheel up
                this.Cursor=Cursors.Cross;//the plus cursor
                }
            else
                {
               // mouse wheel down
               this.Cursor=Cursors.IBeam;
               //windows doesn't have a "-" sign cursor i guess
                }
}
 
Share this answer
 
Comments
valiant123 6-Feb-12 6:39am    
thanks buddy

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900