سؤال

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!

هل كانت مفيدة؟

المحلول

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.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top