From RAD Studio Code Examples
Description
This example demonstrates the use of ShowCaption and WordWrap
properties, and OnBaloonClick event.
Code
__fastcall TMainForm::TMainForm(TComponent* Owner)
: TForm(Owner)
{
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;
}
//---------------------------------------------------------------------------
void __fastcall TMainForm::Button1Click(TObject *Sender)
{
FlowPanel1->Enabled = true;
Panel1->Enabled = true;
RadioGroup1->Enabled = true;
if (FlowPanel1->ShowCaption)
{
FlowPanel1->ShowCaption = false;
Panel1->ShowCaption = false;
}
else
{
FlowPanel1->ShowCaption = true;
Panel1->ShowCaption = true;
}
}
//---------------------------------------------------------------------------
void __fastcall TMainForm::TrayIcon1BalloonClick(TObject *Sender)
{
ShowMessage("You clicked the balloon");
}
Uses