How to hide a Windows form, but keep the taskbar title for it?

I am writing a C # Windows Forms application. How to hide a form while saving it in the Windows taskbar ?

I tried to set the property Visibleto false and use the method Hide(), but they hide both the form and the taskbar entry.

I also tried to minimize the application forever by installing WindowStatein FormWindowState.Minimizedin events OnLoadand onResize. This works very well, but when you left-click on the icon on the taskbar, you will get a quick flash of the application before it changes (which is annoying).

Sorry if this question arose earlier, but every question that I have seen so far hides the taskbar completely or removes the application as an element of the taskbar (replaced by NotifyIcon).

How to fix this problem?

+3
source share
2 answers

Set

FormBorderStyle = None 

& in the Load event:

private void Form1_Load(object sender, EventArgs e)
{
    this.Size = new System.Drawing.Size(0, 0);
}
+4
source

As noted in Decvadin, the paradigm you are using is likely to justify the notification icon. The taskbar is specially designed for minimized windows (and on Win7, launching the application). All other recommendations (opacity of the form, moving the window on the screen, etc.) Fall on Win7 using Aero Peek.

, , ( "" ). .NET WinForms NotifyIcon.

+3

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


All Articles