在做一个多窗口的程序,打开了子窗口后关闭主窗口就全部关闭把Main改成:
static void Main()
{
int count = 1;
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Form1 form1 = new Form1(count);
form1.Show();
Application.Run(); }后来关闭所有窗口又不关闭应用程序(进程),怎么才可以把这两个同时解决。
(附子窗口也可以打开子窗口)(如word),
请各位帮忙。
static void Main()
{
int count = 1;
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Form1 form1 = new Form1(count);
form1.Show();
Application.Run(); }后来关闭所有窗口又不关闭应用程序(进程),怎么才可以把这两个同时解决。
(附子窗口也可以打开子窗口)(如word),
请各位帮忙。
设置 notifyIcon1的上下文菜单为 contextMenuStrip1;
NotifyIcon的点击事件中加入
this.Show();菜单上加一个“退出”项,在Click事件中加入
Application.Exit();在 FormClosing 事件中加入
if (e.CloseReason == CloseReason.UserClosing)
{
e.Cancel = true;
this.Hide();
this.notifyIcon1.ShowBalloonTip(1, this.Text, "系统在后台运行。", ToolTipIcon.Info);
}