Delphi: JEDI TrayIcon hides all frames. error

I have a frame, two buttons and a JEDI TrayIcon (TJvTrayIcon, version 3.40). Delphi XE.

First button:

Frame11.Visible := true; 

Secondly:

 Frame11.Visible := false; 

When I try to minimize the window → restore it from the system tray → click the “Visible: = false” button and then “Visible: = true” = the frame is not displayed.

The problem is [tvAutoHide] TJvTrayIcon visibility.

I do not see this problem in a new project, but I have an old one. I can’t understand why this is happening and how to prevent it. Check out my problematic project: http://www.filedropper.com/trayicon

Thanks for the help!

+4
source share
1 answer

You are right, there is an error in TJvTrayIcon . If AnimateToTray is in the Visibility options, it does not restore the states of Application.ShowMainForm and Application.MainForm.Visible . It shows a window, but "Visible" is still false for your form after it is restored. This leads to any attempt to show that hidden controls fail because their parent does not seem to show.

Bug fixes are beyond the scope of this answer. For workaround:

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

somewhere. For a quick test in the click1 event before showing the frame. But you will want to place it after restoring the main form for the absence of other side effects.

+7
source

Source: https://habr.com/ru/post/1387863/


All Articles