ShowCaption (Delphi)

From RAD Studio Code Examples
Jump to: navigation, search

Description

This example demonstrates the use of the ShowCaption and WordWrap properties, and of the OnBaloonClick event.

Code

procedure TMainForm.Button1Click(Sender: TObject);
begin
  FlowPanel1.Enabled := True;
  Panel1.Enabled := True;
  RadioGroup1.Enabled := True;
  if FlowPanel1.ShowCaption then
  begin
    FlowPanel1.ShowCaption := False;
    Panel1.ShowCaption := False;
  end
  else
  begin
    FlowPanel1.ShowCaption := True;
    Panel1.ShowCaption := True;
  end;
end;

procedure TMainForm.FormCreate(Sender: TObject);
begin
  RadioGroup1.WordWrap := True;
  TrayIcon1.ShowBalloonHint;
  TrayIcon1.Animate := True;
  TrayIcon1.BalloonFlags := bfInfo;
  TrayIcon1.BalloonHint := 'This is the balloon hint';
  TrayIcon1.BalloonTimeout := 1000;
  TrayIcon1.BalloonTitle := 'This is the balloon title';
  TrayIcon1.Hint := 'This is the hint';
  TrayIcon1.Icons := ImageList1;
  TrayIcon1.Visible := True;
  FlowPanel1.Alignment := taRightJustify;
  FlowPanel1.BorderStyle := bsSingle;
  FlowPanel1.Color := clHotLight;
  FlowPanel1.Enabled := False;
  Panel1.Alignment := taCenter;
  Panel1.BorderStyle := bsSingle;
  Panel1.Color := clGreen;
  Panel1.Enabled := False;
end;

procedure TMainForm.TrayIcon1BalloonClick(Sender: TObject);
begin
  ShowMessage('You clicked the balloon');
end;

Uses