创建任意形状的Hint
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
type
TMyHintWindow=class(THintWindow)
protected
procedure Paint;override;
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
{ TMyHintWindow }
procedure TMyHintWindow.Paint;
var
NewShape: HRGN;
begin
NewShape := CreateEllipticRgn(0,2,Width+1,Height);//建立一个椭圆的Hint
SetWindowRgn(Handle, NewShape, TRUE);
Application.HintColor :=$005695AF;
inherited;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
HintWindowClass:=TMyHintWindow;
end;
end.