我们为了将hint显示在StatusBar1上需要如下方法
public
procedure DisplayHint(Sender: TObject);
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
{ Here is the implementation of the OnHint event handler }
{ It displays the application抯 current hint in the status bar }
procedure TForm1.DisplayHint(Sender: TObject);
begin
StatusBar1.SimpleText := Application.Hint;
end;
{ Here is the form抯 OnCreate event handler. }
{ It assign抯 the application抯 OnHint event handler at runtime }
{ because the Application is not available in the Object Inspector }
{ at design time }
procedure TForm1.FormCreate(Sender: TObject);
begin
Application.OnHint := DisplayHint;
end;
其实只需要将
StatusBar1.autohint:=true
即可完成