我试了bubble的方法,完全可以,不过需补充代码完善。(以显示label标签提示为例)具体代码为:
var
Form1: TForm1;
x:THintWindow;
implementation
{$R *.DFM}
procedure TForm1.FormCreate(Sender: TObject);
begin
label1.ShowHint:=true;
label1.Hint:='successlabel';
x:=THintWindow.Create(self);
end;
procedure TForm1.Button1Click(Sender: TObject);
var
rect :TRect;
p
ointer;
MaxWidth,width,height:Integer;
point:TPoint;
begin
rect := x.CalcHintRect(MaxWidth,label1.hint,p);
width:=rect.Bottom-rect.Top;
height:=rect.Right-rect.Left;
point.x:=label1.Left+label1.Width;
point.y:=label1.Top+label1.Height;
Point:=ClientToScreen(Point);
rect.Left:=point.x;
rect.Top:=point.y;
rect.Right:=point.x+height;
rect.Bottom:=point.y+width;
x.Color := clWhite;
x.ActivateHint(rect,label1.Hint);
end;