Responding to a Mouse-down Action

From RAD Studio
Jump to: navigation, search

Go Up to Responding to the Mouse


Whenever the user presses a button on the mouse, an Vcl.Controls.TControl.OnMouseDown event goes to the object the pointer is over. The object can then respond to the event.

To respond to a mouse-down action, attach an event handler to the OnMouseDown event.

The Code editor generates an empty handler for a mouse-down event on the form:

procedure TForm1.FormMouseDown(Sender: TObject; Button: TMouseButton;
 Shift: TShiftState; X, Y: Integer);
begin
end;
void __fastcall TForm1::FormMouseDown(TObject *Sender, TMouseButton Button,
	TShiftState Shift, int X, int Y) {
}

See Also