C#怎样才能实现窗体最小化到托盘呢?

 更新时间:2020年6月25日 11:48  点击:1311
private void Form1_Resize(object sender, System.EventArgs e) {
    if (this.WindowState == FormWindowState.Minimized) {
        this.Visible = false;
        this.notifyIcon1.Visible = true;
    }
}

private void notifyIcon1_Click(object sender, System.EventArgs e) {
    this.Visible = true;
    this.WindowState = FormWindowState.Normal;
    this.notifyIcon1.Visible = false;
}
[!--infotagslink--]

相关文章