Delphi:JEDI TrayIcon 隐藏所有框架。漏洞
我有一个框架、两个按钮和一个 JEDI TrayIcon(TJvTrayIcon,版本 3.40)。德尔福XE。
第一个按钮:
Frame11.Visible := true;
第二个:
Frame11.Visible := false;
当我尝试最小化窗口时 ->从系统托盘恢复它 ->单击“Visible:=false”按钮,然后单击“Visible:=true”= 框架不会出现。
TJvTrayIcon 的可见性的[tvAutoHide]
存在问题。
我在新项目中没有看到这个问题,但在旧项目中却有。我不明白为什么会发生以及如何预防它。 请查看我的问题项目:http://www.filedropper.com/trayicon
感谢您的帮助!
I have a frame, two buttons and a JEDI TrayIcon (TJvTrayIcon, Version 3.40). Delphi XE.
The first button:
Frame11.Visible := true;
Second:
Frame11.Visible := false;
When I try to minimize a window -> restore it from a system tray -> click the "Visible:=false" button and then "Visible:=true" = the frame doesn't appear.
A problem is in [tvAutoHide]
of Visibility of TJvTrayIcon.
I don't see this problem in a new project, but I have in an old one. I cannot understand why it happens and how to prevent it.
Please see my problem project: http://www.filedropper.com/trayicon
Thanks for help!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您是对的,
TJvTrayIcon
中存在错误。当AnimateToTray
处于Visibility
选项中时,它不会恢复Application.ShowMainForm
和Application.MainForm.Visible
状态。它显示窗口,但恢复表单后“可见”仍然为假。这会导致任何显示隐藏控件的尝试都会失败,因为它们的父控件似乎没有显示。修复错误超出了本答案的范围。对于解决方法,请将:
某处。为了进行快速测试,请在显示框架之前在 Button1 单击事件中。但你最好把它放在主窗体恢复之后,以免产生其他副作用。
You're right, there's a bug in the
TJvTrayIcon
. WhenAnimateToTray
is inVisibility
options, it does not restoreApplication.ShowMainForm
andApplication.MainForm.Visible
states. It shows the window but 'Visible' is still false for your form after you restore it. That leads any attempt for showing hidden controls to fail since their parent is seemingly not showing.Fixing the bug is beyond the scope of this answer. For a workaround put:
somewhere. For a quick test, in your Button1 click event before showing the frame. But you would want to put it after the main form is restored for not having other side effects.