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

TStatusBar.GetPanelIndexAt

Gets the ordinal position for the panel at the specified coordinates.

Declaration

Source position: comctrls.pp line 171

public function TStatusBar.GetPanelIndexAt(

  X: Integer;

  Y: Integer

):Integer;

Arguments

X

  

Horizontal coordinate to locate in the Panels for the status bar.

Y

  

Vertical coordinate to locate in the Panels for the status bar.

Function result

Ordinal position for the status panel, or -1 when no panel is located at the specified coordinates.

Description

GetPanelIndexAt gets the ordinal position for the panel at the specified coordinates. The return value is -1 when Panels have not been defined in the status bar. No actions are performed in the method when Panels is empty.

GetPanelIndexAt uses the display rectangle for the control to determine in the specified coordinates are within one of the Panels defined for the control. When True, each of the items in the Panels collection are examined to determine if the point is within a specific panel. The ordinal position for the panel is assigned as the return value.