Events


The following table lists useful events implemented by the Control class. All controls that inherit from this class inherit these properties unless they override the Control class’ behavior.

Open table as spreadsheet

Event

Purpose

AutoSizeChanged

Occurs when the control’s AutoSize property changes.

BackColorChanged

Occurs when the control’s BackColor property changes.

BackgroundImageChanged

Occurs when the control’s BackgroundImage property changes.

BackgroundImageLayoutChanged

Occurs when the control’s BackgroundImageLayout property changes.

Click

Occurs when the user clicks the control. This event is at a higher logical level than the MouseClick event, and it can be triggered by other actions than a mouse click (such as pressing the Enter key or a shortcut key).

ContextMenuChanged

Occurs when the control’s ContextMenu property changes.

ContextMenuStripChanged

Occurs when the control’s ContextMenuStrip property changes.

ControlAdded

Occurs when a new control is added to the control’s contained child controls.

ControlRemoved

Occurs when a control is removed from the control’s contained child controls.

CursorChanged

Occurs when the control’s Cursor property changes.

DockChanged

Occurs when the control’s Dock property changes.

DoubleClick

Occurs when the user double-clicks the control.

DragDrop

Occurs when the user drops something on the control in a drag-and-drop operation. This event handler should process the dropped information appropriately.

DragEnter

Occurs when the user drags something over the control in a drag-and-drop operation.

DragLeave

Occurs when the user drags something off of the control in a drag-and-drop operation.

DragOver

Occurs when the user has dragged something over the control in a drag-and-drop operation. This event fires repeatedly until the user drags off of the control, drops on the control, or cancels the drop.

EnabledChanged

Occurs when the control’s Enabled property changes.

Enter

Occurs when the control is entered. This event fires before the GotFocus event.

FontChanged

Occurs when the control’s Font property changes.

ForeColorChanged

Occurs when the control’s ForeColor property changes.

GiveFeedback

Occurs during a drag-and-drop operation to let the drag source control take action.

GotFocus

Occurs when the control receives the input focus. This event fires after the Enter event. Generally, the Enter event is preferred.

HelpRequested

Occurs when the user requests help for the control. For example, if the user moves the focus to a TextBox and presses F1, the TextBox raises this event.

Invalidated KeyDown

Occurs when part of the control is invalidated. Occurs when the user presses a key while the control has the input focus.

KeyPress

Occurs when the user presses and releases a key while the control has the input focus.

KeyUp

Occurs when the user releases a key while the control has the input focus.

Layout

Occurs when the control should arrange its child controls. This event occurs before the Resize and SizeChanged events and is preferred for arranging child controls.

Leave

Occurs when the input focus leaves the control. This event fires before the LostFocus event.

LocationChanged

Occurs when the control’s Location property changes. This event fires after the Move event fires.

LostFocus

Occurs when the input focus leaves the control. This event fires after the Leave event. Generally, the Leave event is preferred.

MarginChanged

Occurs when the control’s Margin property changes.

MouseCaptureChanged

Occurs when the control loses a mouse capture.

MouseClick

Occurs when the user clicks the mouse on the control.

MouseDoubleClick

Occurs when the user double-clicks the mouse on the control.

MouseDown

Occurs when the user presses a mouse button down over the control.

MouseEnter

Occurs when the mouse enters the control.

MouseHover

Occurs when the mouse hovers over the control.

MouseLeave

Occurs when the mouse leaves the control.

MouseMove

Occurs when the mouse moves over the control.

MouseUp

Occurs when the user releases a mouse button over the control.

MouseWheel

Occurs when the user moves the mouse wheel while the control has the input focus.

Move

Occurs when the control is moved. This event fires before the LocationChanged event fires.

PaddingChanged

Occurs when the control’s Padding property changes.

Paint

Occurs when the control must redraw itself. Normally the program draws on the control during this event (if it draws on the control at all).

ParentChanged

Occurs when the control’s Parent property changes.

QueryContinueDrag

Occurs when something changes during a drag-and-drop operation so that the drag source can decide whether to modify or cancel the drag.

RegionChanged

Occurs when the control’s Region property changes.

Resize

Occurs while the control is resizing. This event occurs after the Layout event, but before the SizeChanged event.

SizeChanged

Occurs while the control is resizing. This event occurs after the Layout and Move events.

SystemColorsChanged

Occurs when the system colors change. For instance, you might want to draw something using the same color that the operating system uses for active forms. If the user changes the system’s color for borders, you can use this event to update your application.

TabIndexChanged

Occurs when the control’s TabIndex property changes.

TabStopChanged

Occurs when the control’s TabStop property changes.

TextChanged

Occurs when the control’s Text property changes.

Validated

Occurs when the control has successfully finished validating its data.

Validating

Occurs when the control should validate its data.

VisibleChanged

Occurs when the control’s Visible property changes.




Visual Basic 2005 with  .NET 3.0 Programmer's Reference
Visual Basic 2005 with .NET 3.0 Programmer's Reference
ISBN: 470137053
EAN: N/A
Year: 2007
Pages: 417

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net