Vcl.Controls.TMouseEvent

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

TMouseEvent = procedure(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer) of object;

C++

typedef void __fastcall (__closure *TMouseEvent)(System::TObject* Sender, System::Uitypes::TMouseButton Button, System::Classes::TShiftState Shift, int X, int Y);

Properties

Type Visibility Source Unit Parent
type
typedef
public
Vcl.Controls.pas
Vcl.Controls.hpp
Vcl.Controls Vcl.Controls

Description

TMouseEvent is the function type for either an OnMouseDown event or an OnMouseUp event.

TMouseEvent has the following parameters:


Parameter Meaning

Sender

The control that generated the event.

Button

The mouse button that is pressed. This parameter can have one of the following values: mbLeft, mbRight, mbMiddle.

Shift

The state of the Alt, Ctrl, Shift keys, and the mouse buttons.

X

The current X coordinate of the mouse cursor.

Y

The current Y coordinate of the mouse cursor.

Note: The X and Y coordinates are based on the Sender. Call ClientToScreen for the global screen coordinates.

See Also

Code Examples