//将notifyicon1 设置Visible为 false,然后: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;
}
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;
}
'//隐藏图标,知道菜单项和图标准备好以后。
mobNotifyIcon = New NotifyIcon()
mobNotifyIcon.Visible = False
mobContextMenu = New ContextMenu()
CreateMenu()
mobNotifyIcon.ContextMenu = mobContextMenu
mobNotifyIcon.Text = "xxx" + _
Microsoft.VisualBasic.ChrW(10) + "http://xml.sz.luohuedu.net/"
SetUpTimer()
mobNotifyIcon.Visible = True
当然要设定Form的属性
代码如下:private void notifyIcon1_DoubleClick(object sender, System.EventArgs e)
{
this.notifyIcon1.Visible = false;
this.WindowState = FormWindowState.Normal;
this.ShowInTaskbar = true;
Show();
}为什么啊?
是不是要设定Form的什么属性啊?