Event
Meaning in Life
Click
Various events that allow you to interact with the mouse
DoubleClick
MouseEnter
MouseLeave
MouseDown
MouseUp
MouseMove
MouseHover
MouseWheel
KeyPress
Various events that allow you to interact with the keyboard
KeyUp
KeyDown
DragDrop
Various events used to monitor drag-and-drop activity
DragEnter
DragLeave
DragOver
Paint
An event that allows you to interact with the graphical rendering services of GDI+
Finally, the Control base class also defines a number of methods that allow you to interact with
any Control-derived type. As you examine the methods of the Control type, you will notice that a
good number of them have an On prefix followed by the name of a specific event (OnMouseMove,
OnKeyUp, OnPaint, etc.). Each of these On-prefixed virtual methods is the default event handler for its
respective event. If you override any of these virtual members, you gain the ability to perform any
necessary pre- or postprocessing of the event before (or after) invoking your parent’s default imple-
mentation:
public partial class MainWindow : Form
{
protected override void OnMouseDown(MouseEventArgs e)
{
Do'stlaringiz bilan baham: |