RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TApplication.ShowHint Property

Determines whether Help Hints are enabled or disabled for the entire application.

Pascal
property ShowHint: Boolean;
C++
__property Boolean ShowHint;

Use ShowHints to choose when to display Help Hints. If ShowHint is true, Help Hints are enabled; if ShowHint is false, Help Hints are disabled. The default value is true. Help Hints are specified in the Hint property. 

Setting ShowHint for the application to false disables all Help Hints, regardless of the value of the ShowHint properties for individual controls.

Tip: You can customize the hint window by creating a custom descendant of THintWindow and assigning it to the global HintWindowClass variable.
 

C++ Examples: 

 

/*
This example uses an edit box and a list box on a form.  
Items are added to the list box and a Help Hint is assigned 
to both controls. The last statement enables the Help Hints
for the entire application.
*/
void __fastcall TForm1::FormCreate(TObject *Sender)
{
  Edit1->Hint = "Enter your name";
  Edit1->ShowHint = true;

  char string[10];
  char index[3];
  for(int i = 1; i <= 10; i++)
  {
    strcpy(string, "Item");
    itoa(i, index, 10);
    strcat(string, index);
    ListBox1->Items->Add(string);
  }
  ListBox1->Hint = "Select an item";
  ListBox1->ShowHint = true;
  Application->ShowHint = true;
}
/*
Note: To see an example that displays the hints of controls
in some place other than in a Help Hint box, see the OnHint
example.
*/

 

Delphi Examples: 

{
This example uses an edit box and a list box on a form.  
Items are added to the list box and a Help Hint is assigned 
to both controls. The last statement enables the Help Hints
for the entire application.
} 
procedure TForm1.FormCreate(Sender: TObject);
var
  I: Integer;
begin
  Edit1.Hint := 'Enter your name';
  Edit1.ShowHint := True;
  with ListBox1 do
  begin
    for I := 1 to 10 do
      Items.Add('Item ' + IntToStr(I));
    Hint := 'Select an item';
    ShowHint := True;
  end;
  Application.ShowHint := True;
end;
{
Note: To see an example that displays the hints of controls
in some place other than in a Help Hint box, see the OnHint
example.
}

 

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!