Using the Common Mouse Events

As with keyboard input, most controls support mouse input natively; you don't have to write code to deal with mouse input. At times, you might need more control than that offered by the native functionality of a control, however. Visual C# .NET supports six events that enable you to deal with mouse input directly. These events are listed in Table 17.5, in the order in which they occur.

Table 17.5. Events Used to Handle Mouse Input
Event NameDescription
MouseEnterOccurs when the pointer enters a control.
MouseMoveOccurs when the pointer moves over a control.
MouseHoverOccurs when the pointer hovers over a control.
MouseDownOccurs when the pointer is over a control and a button is pressed.
MouseUpOccurs when the pointer ...

Get Sams Teach Yourself Microsoft® Visual C#™ .NET in 24 Hours now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.