Sign in Join
FPDoc Onlineexperiment

TTabControl.IndexOfTabAt function

Member of TTabControlpublicIn unit ComCtrls

Gets the position for the tab at the specified mouse coordinates.

Declaration

pascal
function IndexOfTabAt(X: Integer; Y: Integer): Integer; override
function IndexOfTabAt(P: TPoint): Integer; override

Arguments

X

Horizontal coordinate for the mouse pointer.

Y

Vertical coordinate for the mouse pointer.

P

TPoint instance with the mouse coordinates.

Function result

Ordinal position for the hovered tab in the Tabs property.

Description

IndexOfTabAt is an overridden overloaded Integer function used to get the position for the tab at the specified mouse coordinates. The overloaded variants allow the mouse coordinates to be specified as a TPoint instance, or two Integer values.

IndexOfTabAt re-implements the methods from the ancestor class to use the TTabControlNoteBookStrings instance in Tabs. Tabs provides the offset for the control from the value in ClientOrigin. The IndexOfTabAt method in Tabs is called to get the return value for the method.

The return value contains the ordinal position in Tabs where the mouse pointer is located.

See also

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.