标签:
private void Form1_Resize(object sender, EventArgs e) { if (this.WindowState == FormWindowState.Minimized)//最小化到系统托盘 { notifyIcon1.Visible = true;//显示托盘图标 this.Hide();//隐藏窗口 } } private void notifyIcon1_MouseClick(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Left) { this.Show(); WindowState = FormWindowState.Normal; this.Focus(); } } private void label_min_Click(object sender, EventArgs e) { this.WindowState = FormWindowState.Minimized; } private void label_close_Click(object sender, EventArgs e) { this.WindowState = FormWindowState.Minimized;//使关闭时窗口向右下角缩小的效果 }
标签:
原文地址:http://www.cnblogs.com/margin-gu/p/5015779.html