var CursorPos: TPoint; begin CursorPos := Point(Button1.Width div 2, Button1.Height div 2); CursorPos := Button1.ClientToScreen(CursorPos); Button1.ShowHint := true; Button1.Hint := 'ccccccccc'; SetCursorPos(CursorPos.X, CursorPos.y); Application.HintPause := 0;
var h: THintWindow; r: TRect; p: TPoint; begin GetCursorPos(p); with r do begin left := p.X; top := p.Y; right := p.X + 100; bottom := p.Y + 20; end; h := THintWindow.Create(Self); with h do begin ActivateHint(r, 'hi there!'); // ReleaseHandle; // Free; end;
var h: THintWindow; r: TRect; p: TPoint; begin GetCursorPos(p); with r do begin left := p.X; top := p.Y; right := p.X + 100; bottom := p.Y + 20; end; h := THintWindow.Create(Self); with h do begin ActivateHint(r, 'hi there!'); sleep(10000); //10秒后自动消失 ReleaseHandle; Free; end;end;
CursorPos: TPoint;
begin
CursorPos := Point(Button1.Width div 2, Button1.Height div 2);
CursorPos := Button1.ClientToScreen(CursorPos); Button1.ShowHint := true;
Button1.Hint := 'ccccccccc';
SetCursorPos(CursorPos.X, CursorPos.y); Application.HintPause := 0;
h: THintWindow;
r: TRect;
p: TPoint;
begin
GetCursorPos(p);
with r do
begin
left := p.X;
top := p.Y;
right := p.X + 100;
bottom := p.Y + 20;
end;
h := THintWindow.Create(Self);
with h do
begin ActivateHint(r, 'hi there!');
// ReleaseHandle;
// Free;
end;
h: THintWindow;
r: TRect;
p: TPoint;
begin
GetCursorPos(p);
with r do
begin
left := p.X;
top := p.Y;
right := p.X + 100;
bottom := p.Y + 20;
end;
h := THintWindow.Create(Self);
with h do
begin ActivateHint(r, 'hi there!'); sleep(10000); //10秒后自动消失
ReleaseHandle;
Free;
end;end;