既然问到hint,我就把前几天的心得给你:
如果创建自己的hint窗体?(也就是自定义)
你查看 FlatStyle 和 Vcl 源码,会给你很多提示
//首先定义一个hint类
type
TMyHint = class(THintWindow)
protected
procedure Paint; override;
public
procedure ActivateHint (HintRect: TRect; const AHint: string); Override;
constructor Create(AOwner: TComponent);override;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
HintWindowClass := TMyHint;
end;
constructor TMyHint.Create(AOwner: TComponent);
var
region: HRgn;
begin
inherited Create(AOwner);
region:=CreateEllipticRgn(1,1,200,200);//圆形。也可以根据图片来创建形状
//自己随便了
SetWindowRgn(handle, region, true);
end;
procedure TMyHint.Paint;
begin
Color := clblue;//背景颜色
canvas.TextOut(clientRect.Left+100,clientRect.Top,Caption);//hint文字
//位置,要计算好
end;
procedure TMyHint.ActivateHint (HintRect: TRect; const AHint: string);
begin
Caption := AHint;
SetWindowPos(Handle, HWND_TOPMOST, HintRect.Left, HintRect.Top, 200, 200, SWP_SHOWWINDOW or SWP_DRAWFRAME or SWP_NOACTIVATE);
//SWP_DRAWFRAME 必须有,否则不会画出你的hint窗口图形来
end;