Go into the application options in C task manager to hide the method details of the program itself

  • 2020-05-12 03:04:33
  • OfStack

In the C# winform application, one such application is often used: when the form is minimized, hide the taskbar icon of the program, and display the icon of the program on the tray, which can be realized with the following code:

private void Form1_SizeChanged(object sender, EventArgs e)
{
    if (this.WindowState == FormWindowState.Minimized)
    {
        this.ShowInTaskbar = false;// Hide the taskbar TAB 
        this.notifyIcon1.Visible = true;// Display tray icon 
    }
    else
    {
        this.ShowInTaskbar = true;
        this.notifyIcon1.Visible = false;
    }
}

Sometimes, if you want to hide the program's options in your application in task management, one of the easiest ways to do this is to leave the Text of the main form as an empty string so that you can hide the program's options from the task manager's application.

Related articles: