private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
//MessageBox.Show("程序将最小化到系统托盘区");
e.Cancel = true; // 取消关闭窗体
this.Hide();
this.ShowInTaskbar = false;//取消窗体在任务栏的显示
this.notifyIcon1.Visible = true;//显示托盘图标
}
private void menuShow_Click(object sender, EventArgs e)
{
this.Show();
this.ShowInTaskbar = true;
this.notifyIcon1.Visible = false;
}
private void menuExit_Click(object sender, EventArgs e)
{
this.Dispose(true);
Application.ExitThread();
}
private void notifyIcon1_MouseClick(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
{
this.Show();
this.ShowInTaskbar = true;
this.notifyIcon1.Visible = false;
}
}
using System;
using System.Collections.Generic;
using System.Windows.Forms;
using System.Threading;
namespace LuceneTest
{
static class Program
{
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main()
{
bool bCreatedNew;
Mutex m = new Mutex(false, "Product_Index_Cntvs", out bCreatedNew);
if (bCreatedNew)
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
}
}
}
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有