ShowAccelChar (C++)

From RAD Studio Code Examples
Jump to: navigation, search

Description

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.

Code

__fastcall TForm1::TForm1(TComponent* Owner)
  : TForm(Owner)
{
  Label1->ShowAccelChar = true;
  Label1->Caption = "An &Underlined character appears here";
  Label2->ShowAccelChar = false;
  Label2->Caption = "An ampersand (&) appears here";
}

Uses