[Overview][Constants][Types][Classes][Procedures and functions][Index] |
The control associated with the label and its accelerator key (AccelChar).
Source position: stdctrls.pp line 1528
protected property TCustomLabel.FocusControl : TWinControl |
Set FocusControl to the control that shall receive the focus, when the label's accelerator key is pressed.
A label control cannot receive the focus (it's read-only), but can display an accelerator key indicator, just as menu entries can do.
A windowed control (Edit...) can receive focus, but cannot indicate an accelerator key.
Using a combination of both an label and another control allows one to specify both the accelerator key, in the label's caption, and make the other control receive the focus when the user presses that accelerator key.
An accelerator key is marked by an ampersand '&' in the label's caption, immediately preceding the character to be used as the accelerator key. The marked character appears underlined on screen, when ShowAccelChar=True.
E.g. 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 makes the NameLabel1 displayed as 'Name'.
|
Underlines the character in the label that acts as an accelerator with a shortcut key. |
lazarus-ccr.sourceforge.net |