Forcing a non blocking temporary hint window in Delphi

南笙酒味 提交于 2019-12-04 07:20:18

You can use a CustomHint:

with TCustomHint.Create(Self) do begin
  Title := 'temporary message';
  Delay := 0;
  HideAfter := 2000;
  ShowHint(Point(X, Y));
end;

However it is not destroyed at the time it's hidden, but when its owner (Self) is destroyed. But you can of course re-use the same hint instance.

You can use THintWindow for this. Create an instance of THintWindow and when you want to show the window call ActivateHint. When you are ready to close the window call ReleaseHandle. If you want to have the hint window close after a period of time, you'll want to run a timer to allow you the opportunity to ReleaseHandle when time is up.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!