将hint显示在StatusBar1上
【打印文章】
我们为了将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
即可完成
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
即可完成
本栏文章均来自于互联网,版权归原作者和各发布网站所有,本站收集这些文章仅供学习参考之用。任何人都不能将这些文章用于商业或者其他目的。( Pfan.cn )
【编程爱好者论坛】