private void LANTalkIcon_MouseClick(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Right) { IconMenu.Show(); } if (e.Button == MouseButtons.Left) { switch (Mode) { case 0: this.Show(); this.Activate(); this.WindowState = FormWindowState.Normal; break; case 1: ServerForm.Show(); ServerForm.Activate(); ServerForm.WindowState = FormWindowState.Normal; break; case 2: ClientForm.Show(); ClientForm.Activate(); ClientForm.WindowState = FormWindowState.Normal; break; } } }
static void Main() { IconMenu menu = new IconMenu(); menu.Show(); Application.Run(); }
/// <summary> /// 右键菜单 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void notify_MouseClick(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Right) { IconMenu.Items[0].Text = Program.infoResource.GetLocalizedString(language.InfoId.APPExit); IconMenu.Show(); } }