是否有与JEDI 桌面警报(桌面右下角的一种气球)类似的好方法/等价物?
Balloon hint
不能像堆栈一样显示(新提示位于其他提示之上),但 JEDI Desktop Alert 可以做到。
可能有人知道,为什么该组件的 show 事件会触发两次而不是一次?:)
感谢您的建议!
这可能有点晚了,但下面是使用 Jedi Desktop Alert 在右下角显示 5 个堆叠的警报窗口的基本示例。
unit Unit1;
interface
uses
Winapi.Windows,
Winapi.Messages,
System.SysUtils,
System.Variants,
System.Classes,
Vcl.Graphics,
Vcl.Controls,
Vcl.Forms,
Vcl.Dialogs,
Vcl.StdCtrls,
JvDesktopAlert;
type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
procedure AddAlert(title, text: String; stack: TjvDesktopAlertStack);
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.AddAlert(title, text: String; stack: TjvDesktopAlertStack);
Begin
with TJvDesktopAlert.Create(self) do
Begin
AutoFree := true;
AlertStack := stack;
HeaderText := title;
MessageText := text;
Execute(self.Handle);
End;
End;
procedure TForm1.Button1Click(Sender: TObject);
var
stack: TjvDesktopAlertStack;
begin
stack := TJvDesktopAlertStack.Create(self);
try
AddAlert('title1', 'message1', stack);
AddAlert('title2', 'message2', stack);
AddAlert('title3', 'message3', stack);
AddAlert('title4', 'message4', stack);
AddAlert('title5', 'message5', stack);
finally
stack.Free;
end;
end;
end.
TMS Software 有TAdvAlertWindow,一个“Outlook 2003、2007 风格的警报窗口”。
它是一个商业组件,可单独使用或作为 TMS 组件包的一部分提供。
更新:上图取自 TMS 网站。正如 Andreas 所指出的,该字体没有抗锯齿(它是一种位图字体,可能是 MS Sans Serif)。我已经测试了该组件的试用版并将字体设置为 Tahoma 可以按预期工作: