unit ShowAccelChar;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  TForm1 = class(TForm)
    Label1: TLabel;
    Label2: TLabel;
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

// BeginExample: ShowAccelChar
// Method: StdCtrls.TCustomLabel.ShowAccelChar

// BeginCode
{
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;
// EndCode
// EndExample: ShowAccelChar
end.
