[Overview][Constants][Types][Classes][Procedures and functions][Index] | Reference for unit 'ComCtrls' (#lcl)

# TCustomTabControl.IndexOfPageAt

Gets the ordinal position for the page object located at the specified client coordinates.

## Declaration

Source position: comctrls.pp line 452

`protected function TCustomTabControl.IndexOfPageAt(`
`X: Integer;`
`Y: Integer`
`):Integer; virtual; overload; function TCustomTabControl.IndexOfPageAt(`
`P: TPoint`
`):Integer; virtual; overload;`

## Arguments

`X` |  | Horizontal client coordinate for the page position located in the method.
`Y` |  | Vertical client coordinate for the page position located in the method.

## Function result

Ordinal position for the page object located the specified client coordinates.

## Arguments

`P` |  | TPoint instance with the client coordinates for the requested page index.

## Description

IndexOfPageAt is an overloaded method in TCustomTabControl used to get the ordinal position for the page object located at the specified client coordinates. The overloaded variants allow the client coordinates to be specified as separate Integer values, or as a TPoint instance where the X and Y members contain the client-relative coordinates.

Example Usage:

    APos := TabControl1.IndexOfPageAt(TabControl1.ScreenToClient(Mouse.CursorPos));

## See also

TCustomTabControl.Page |  | Provides indexed access to the page objects used on the tabbed control.
TCustomTabControl.PageCount |  | Returns the number of page objects stored in the internal page list for the tabbed control.
TCustomTabControl.Tabs |  | Contains the list of pages accessible in the tabbed control.
TCustomTabControl.TabToPageIndex |  | Gets the real page index for the specified tab.
TCustomTabControl.IndexOfTabAt |  | Returns the ordinal position for the visible tab located at the specified client coordinates.