源代码如下: 请在工具栏把notifyIcon控件拖入窗体再使用: C#代码 //隐藏窗体 private bool windowCreate = true; private void toolStripMenuItem1_Click(