treecombobox ShowAccelChar property
Return to Introduction  Previous page  Next page
Applies to
acEdit, acNumberEdit, acIPEdit, acLabeledComboBox, acMRUComboBox, acImagesComboBox and TacTreeComboBox components as subproperty of AttachedLabel structure.  

Declaration
property ShowAccelChar: Boolean;  

Description
The ShowAccelChar property determines how an ampersand in the label text is displayed.  
 
Set ShowAccelChar to True to allow the label to display an underlined accelerator key value. When ShowAccelChar is True, any character preceded by an ampersand (&) appears underlined. If the FocusControl property is set, the windowed control specified by the FocusControl property receives input focus when the user types that underlined character. To display an ampersand when ShowAccelChar is True, use two ampersands (&&) to stand for the single ampersand that is displayed.  
 
Set ShowAccelChar to False to display the label text with all ampersands appearing as ampersands.  

Example
This example uses two labels on a form. The first label has a caption with an accelerator character in it. The second label also includes an ampersand, but it does not appear as an accelerator character.  
 
procedure TForm1.FormCreate(Sender: TObject);  
begin  
  Label1.ShowAccelChar := True;  
  Label1.Caption := 'An &Underlined character appears here';  
  Label2.ShowAccelChar := False;  
  Label2.Caption := 'An ampersand (&) appears here';  
end;  

See also
Caption property.