// += new (this.Form1_SizeChanged);
//The above line is the reference to be added in the InitializeComponent() method of the main form
private void Form1_SizeChanged(object sender, EventArgs e)
{
if (==)
{
();
this.=true;
}
}
.Add a click icon event (first you need to add an event reference):
private void notifyIcon1_Click(object sender, EventArgs e)
{
= true;
= ;
this. = false;
}
.You can add a right-click menu to notifyIcon:
Drag a ContextMenu control contextMenu1 into the main form, click the control, add a menu in the context menu, and select contextMenu1 as the context menu in the ContextMenu behavior of notifyIcon1.
(You can add behavior in the submenu)