Control 類別的事件
AutoSizeChanged += EventHandler(object sender, EventArgs e);
BackColorChanged += EventHandler(object sender, EventArgs e);
BackgroundImageChanged += EventHandler(object sender, EventArgs e);
BackgroundImageLayoutChanged += EventHandler(object sender, EventArgs e);
BindingContextChanged += EventHandler(object sender, EventArgs e);
CausesValidationChanged += EventHandler(object sender, EventArgs e);
ChangeUICues += UICuesEventHandler(object sender, UICuesEventArgs e);
Click += EventHandler(object sender, EventArgs e);
ClientSizeChanged += EventHandler(object sender, EventArgs e);
ContextMenuChanged += EventHandler(object sender, EventArgs e);
ContextMenuStripChanged += EventHandler(object sender, EventArgs e);
ControlAdded += ControlEventHandler(object sender, ControlEventArgs e);
ControlRemoved += ControlEventHandler(object sender, ControlEventArgs e);
CursorChanged += EventHandler(object sender, EventArgs e);
DockChanged += EventHandler(object sender, EventArgs e);
DoubleClick += EventHandler(object sender, EventArgs e);
DpiChangedAfterParent += EventHandler(object sender, EventArgs e);
DpiChangedBeforeParent += EventHandler(object sender, EventArgs e);
DragDrop += DragEventHandler(object sender, DragEventArgs e);
DragEnter += DragEventHandler(object sender, DragEventArgs e);
DragLeave += EventHandler(object sender, EventArgs e);
DragOver += DragEventHandler(object sender, DragEventArgs e);
EnabledChanged += EventHandler(object sender, EventArgs e);
Enter += EventHandler(object sender, EventArgs e);
FontChanged += EventHandler(object sender, EventArgs e);
ForeColorChanged += EventHandler(object sender, EventArgs e);
GiveFeedback += GiveFeedbackEventHandler(object sender, GiveFeedbackEventArgs e);
GotFocus += EventHandler(object sender, EventArgs e);
HandleCreated += EventHandler(object sender, EventArgs e);
HandleDestroyed += EventHandler(object sender, EventArgs e);
HelpRequested += HelpEventHandler(object sender, HelpEventArgs hlpevent);
ImeModeChanged += EventHandler(object sender, EventArgs e);
Invalidated += InvalidateEventHandler(object sender, InvalidateEventArgs e);
KeyDown += KeyEventHandler(object sender, KeyEventArgs e);
KeyPress += KeyPressEventHandler(object sender, KeyPressEventArgs e);
KeyUp += KeyEventHandler(object sender, KeyEventArgs e);
Layout += LayoutEventHandler(object sender, LayoutEventArgs e);
Leave += EventHandler(object sender, EventArgs e);
LocationChanged += EventHandler(object sender, EventArgs e);
LostFocus += EventHandler(object sender, EventArgs e);
MarginChanged += EventHandler(object sender, EventArgs e);
MouseCaptureChanged += EventHandler(object sender, EventArgs e);
MouseClick += MouseEventHandler(object sender, MouseEventArgs e);
MouseDoubleClick += MouseEventHandler(object sender, MouseEventArgs e);
MouseDown += MouseEventHandler(object sender, MouseEventArgs e);
MouseEnter += EventHandler(object sender, EventArgs e);
MouseHover += EventHandler(object sender, EventArgs e);
MouseLeave += EventHandler(object sender, EventArgs e);
MouseMove += MouseEventHandler(object sender, MouseEventArgs e);
MouseUp += MouseEventHandler(object sender, MouseEventArgs e);
MouseWheel += MouseEventHandler(object sender, MouseEventArgs e);
Move += EventHandler(object sender, EventArgs e);
PaddingChanged += EventHandler(object sender, EventArgs e);
Paint += PaintEventHandler(object sender, PaintEventArgs e);
ParentChanged += EventHandler(object sender, EventArgs e);
PreviewKeyDown += PreviewKeyDownEventHandler(object sender, PreviewKeyDownEventArgs e);
QueryAccessibilityHelp += QueryAccessibilityHelpEventHandler(object sender, QueryAccessibilityHelpEventArgs e);
QueryContinueDrag += QueryContinueDragEventHandler(object sender, QueryContinueDragEventArgs e);
RegionChanged += EventHandler(object sender, EventArgs e);
Resize += EventHandler(object sender, EventArgs e);
RightToLeftChanged += EventHandler(object sender, EventArgs e);
SizeChanged += EventHandler(object sender, EventArgs e);
StyleChanged += EventHandler(object sender, EventArgs e);
SystemColorsChanged += EventHandler(object sender, EventArgs e);
TabIndexChanged += EventHandler(object sender, EventArgs e);
TabStopChanged += EventHandler(object sender, EventArgs e);
TextChanged += EventHandler(object sender, EventArgs e);
Validated += EventHandler(object sender, EventArgs e);
Validating += CancelEventHandler(object sender, CancelEventArgs e);
VisibleChanged += EventHandler(object sender, EventArgs e);
EventHandler 是 System 命名空間,CancelEventHandler 是 System.ComponentModel 命名空間,剩下的是 System.Windows.Forms 命名空間。
由於參數型式都是固定的 (sender, e),所以使用 lambda 來設計事件的話,就不用管什麼 XxxHandler 和 XxxArgs,只需要知道 += 前面有哪些事件可用就好~