//from Delphi Help
type
TForm1 = class(TForm)
Panel1: TPanel;
SpeedButton1: TSpeedButton;
SpeedButton2: TSpeedButton;
SpeedButton3: TSpeedButton;
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
procedure DoShowHint(var HintStr: string; var CanShow: Boolean;
var HintInfo: THintInfo);
end;
var
Form1: TForm1;
implementation{$R *.DFM}
procedure TForm1.DoShowHint(var HintStr: string; var CanShow: Boolean; var HintInfo: THintInfo);
begin
if HintInfo.HintControl = SpeedButton3 then
begin
with HintInfo do
begin
HintColor := clAqua;{ Changes only for this hint }
HintMaxWidth := 120;{Hint text word wraps if width is greater than 120 }
Inc(HintPos.X, SpeedButton3.Width); { Move hint to right edge } end;
end;
end;procedure TForm1.FormCreate(Sender: TObject);
begin
Application.ShowHint := True;
Application.OnShowHint := DoShowHint;
end;
end.
type
TForm1 = class(TForm)
Panel1: TPanel;
SpeedButton1: TSpeedButton;
SpeedButton2: TSpeedButton;
SpeedButton3: TSpeedButton;
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
procedure DoShowHint(var HintStr: string; var CanShow: Boolean;
var HintInfo: THintInfo);
end;
var
Form1: TForm1;
implementation{$R *.DFM}
procedure TForm1.DoShowHint(var HintStr: string; var CanShow: Boolean; var HintInfo: THintInfo);
begin
if HintInfo.HintControl = SpeedButton3 then
begin
with HintInfo do
begin
HintColor := clAqua;{ Changes only for this hint }
HintMaxWidth := 120;{Hint text word wraps if width is greater than 120 }
Inc(HintPos.X, SpeedButton3.Width); { Move hint to right edge } end;
end;
end;procedure TForm1.FormCreate(Sender: TObject);
begin
Application.ShowHint := True;
Application.OnShowHint := DoShowHint;
end;
end.
解决方案 »
- 如何用DELPHI读取自己QQ上面所有的群号码?
- 怎么在treeview中节点中储存一个字符串变量?
- 为什么数据没有更新,我的程序如下?我觉得是没有错误的
- 高分相求教,excel列合并后,写入数据后不能上下自动串列显示?
- 怎么在主窗口上放一个模式对话框,用作用户登录?
- 今天心情非常非常不好!!散分……【二】
- 一个关于数据的的删除问题
- 很菜的问题: 怎样获得系统信息?比如当前桌面分辨率.
- 要把自定义的函数放在哪里申明,才能被另外的.pas文件调用啊?
- 我有一个字段为Money型(后台数据库为SQLServer),我想在DBGRid中显示'$'符号。
- 那里可以DOWN到《MASTERING DELPHI6》??
- 很菜的问题。一定给分!
procedure TMainForm.FormCreate(Sender: TObject);
begin
Application.OnHint := ShowHint;
//....
end;//....
procedure TMainForm.ShowHint(Sender: TObject);
begin
if Length(Application.Hint) > 0 then
begin
StatusBar.SimplePanel := True;
StatusBar.SimpleText := Application.Hint;
end
else StatusBar.SimplePanel := False;
end;
//....
OnShowHint中捕捉
设置StatusBar1的AutoHint为True,就可以在控件上方显示 "我的",
在StatusBar1的Panels[0]中显示"这样".
只能在Panels[0]中显示。
Left = 0
Top = 329
Width = 536
Height = 19
AutoHint = True
Panels = <>
SimplePanel = True
end