Sign in Join
FPDoc Onlineexperiment

TDBText.FocusControl property

Member of TDBTextpublishedIn unit DBCtrls

The control associated with the label and its accelerator key (AccelChar).

Declaration

pascal
property FocusControl:;

Description

Set FocusControl to the control which is focused when the accelerator key in the label is pressed.

A label control cannot receive the input focus (it is read-only), but can display an accelerator key indicator, just like a menu entries. A windowed control (Edit...) can receive focus, but cannot indicate an accelerator key.

Using a combination of a label and another control allows setting the accelerator key in the label caption. The other control receives focus when the user presses the accelerator key.

An accelerator key is marked by an Ampersand '&' in the label caption, immediately preceding the character to be used as the accelerator key. The marked character appears underlined on screen, when ShowAccelChar is set to True (but only if the label is not rotated).

For example: When you have a NameEdit1 control on a form, preceded by a label NameLabel1, you can set NameLabel1.FocusControl to NameEdit1, and NameLabel1.Caption to '&Name'.

This description is the one of StdCtrls.TCustomLabel.FocusControl.

See also

  • ShowAccelChar

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