Delphi:JEDI TrayIcon 隐藏所有框架。漏洞

发布于 2024-12-22 15:38:34 字数 535 浏览 6 评论 0原文

我有一个框架、两个按钮和一个 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

双手揣兜 2024-12-29 15:38:34

您是对的,TJvTrayIcon 中存在错误。当AnimateToTray处于Visibility选项中时,它不会恢复Application.ShowMainFormApplication.MainForm.Visible状态。它显示窗口,但恢复表单后“可见”仍然为假。这会导致任何显示隐藏控件的尝试都会失败,因为它们的父控件似乎没有显示。

修复错误超出了本答案的范围。对于解决方法,请将:

Application.ShowMainForm := True;
Visible := True;

某处。为了进行快速测试,请在显示框架之前在 Button1 单击事件中。但你最好把它放在主窗体恢复之后,以免产生其他副作用。

You're right, there's a bug in the TJvTrayIcon. When AnimateToTray is in Visibility options, it does not restore Application.ShowMainForm and Application.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:

Application.ShowMainForm := True;
Visible := True;

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文