Databases Reference
In-Depth Information
is raised. Events can have event-specific data (for example, a mouse-down event can
include data about the screen cursor's location).
The event handler signature observes the following conventions:
• The return type is Void .
• The first parameter is named sender and is of type Object . This represents the
object that raised the event.
• The second parameter is named e and is of type EventArgs or a derived class of
EventArgs . This represents the event-specific data.
• The event takes only these two parameters.
Common Events Raised by Controls
Various controls come with Visual Studio 2008, and they are built to achieve different
functionality from one another. However, the industry has identified a few events that are
common among many controls, and most applications use only these types of controls.
Table 17-1 describes the common events among various controls.
Table 17-1. Common Events
Event Name
Description
Click
Usually occurs on left mouse click. This event can also occur with keyboard
input in the situation when the control is selected and the Enter key is pressed.
DoubleClick
Occurs when left mouse button is clicked twice rapidly.
KeyDown
Occurs when a key is pressed and a control has the focus.
KeyPress
Occurs when a key is pressed and a control has the focus.
KeyUp
Occurs when a key is released and a control has the focus.
MouseClick
Occurs only when a control is being clicked by the mouse.
MouseDoubleClick
Occurs when a control gets double-clicked by the mouse.
MouseDown
Occurs when the mouse pointer is located over a control and the mouse
button is being clicked.
MouseUp
Occurs when a mouse button is released over a control.
MouseEnter
Occurs when the mouse pointer enters a control.
MouseHover
Occurs when the mouse pointer is positioned over a control.
MouseLeave
Occurs when the mouse pointer rests on a control.
MouseMove
Occurs when the mouse rotates or moves over a control.
MouseWheel
Occurs when the user revolves the mouse wheel and a control has the focus.
Search WWH ::




Custom Search