在Delphi中强制一个非阻塞的临时提示窗口 [英] Forcing a non blocking temporary hint window in Delphi
问题描述
我一直在搜索,但是找不到解决方案,所以我想也许应该将其发布。
I've been searching, but cannot find a solution so I figured perhaps I should simply post it.
这就是我想在Delphi中做的事情(2009):
Here's what I'd like to do, in Delphi (2009):
在我的应用程序中的某个时刻,我想向用户显示一条消息。
At a certain moment in my application, I'd like to show a message to the user.
这应该是正常的提示窗口,在正常的应用程序定义的提示暂停后,该窗口会自动消失,并带有自定义消息(并自动调整大小等)。
This should be the normal hint window, which automatically disappears after the normal application defined hint pause, with a custom message (and have it automatically sized etc etc).
这应该是非阻塞的,就像正常的提示一样,不依赖于当前控件或任何其他内容。
This should be non blocking, like a normal hint, not dependent on the current control or whatever.
仅显示该死的消息,在应用程序提示窗口中并继续。
"Just show the damn message", in the Application hint window and carry on.
有任何线索吗?
推荐答案
您可以使用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.
这篇关于在Delphi中强制一个非阻塞的临时提示窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!