系统托盘图标
来源:互联网 发布:c语言游戏编程 编辑:程序博客网 时间:2024/04/27 06:26
一个菜单栏
一个按钮
public partial class FrmMain : Form { bool isExit = false; public FrmMain() { InitializeComponent(); } private void FrmMain_Load(object sender, EventArgs e) { this.WindowState = FormWindowState.Maximized; this.notifyIcon1.Visible = false; } private void FrmMain_FormClosing(object sender, FormClosingEventArgs e) { if (!isExit) { e.Cancel = true; this.Hide(); this.tool_exit.PerformClick(); //默认是最小化 } } private void notifyIcon1_MouseDoubleClick(object sender, MouseEventArgs e) { this.Show(); this.WindowState = FormWindowState.Maximized; } private void ContextM_open_Click(object sender, EventArgs e) { this.Show(); this.WindowState = FormWindowState.Maximized; } private void contextM_exit_Click(object sender, EventArgs e) { // *************************************************************************************** string message = "你确定退出本程序?"; string caption = "提示信息!"; MessageBoxIcon msgBoxIcon = MessageBoxIcon.Information; MessageBoxButtons msgBtn = MessageBoxButtons.OKCancel; DialogResult result = MessageBox.Show(message, caption, msgBtn, msgBoxIcon); if (result == System.Windows.Forms.DialogResult.OK) { isExit = true; Application.Exit(); } } private void tool_exit_Click(object sender, EventArgs e)//仅托盘图标,默认退出要点击右键 { if (!isExit) { // *************************************************************************************** this.Hide(); //notifyIcon1.Icon = this.Icon; notifyIcon1.Text = "计划任务执行"; this.notifyIcon1.Visible = true; this.notifyIcon1.ShowBalloonTip(5000, "提示", "系统仍在运行!", ToolTipIcon.Info); // *************************************************************************************** } } }
0 0
- 系统托盘图标
- 系统托盘图标
- 添加系统托盘图标
- 添加系统托盘图标
- 系统托盘图标VC
- java实现系统托盘图标
- c++实现系统托盘图标
- c++实现系统托盘图标
- 系统托盘图标的实现
- 系统托盘图标图片问题
- Delphi实现系统托盘图标
- 隐藏Windows系统托盘图标
- 获取Windows系统托盘图标
- 完美隐藏系统托盘图标
- VC 任务栏 系统托盘图标
- Windows 系统托盘图标
- 系统托盘中的快捷图标
- VC实现系统托盘图标
- 山东科技大学现最牛考研 9个宿舍40人考研全成功
- MapReduce:并行计算框架
- js里面正则表达式,匹配字符,不断更新
- C#用SerialPort实现串口通讯
- Delphi中画一个矩形
- 系统托盘图标
- [转]JVM调优总结
- java web中实现同一帐号同一时间只能一个地点登陆(类似QQ登录的功能)
- resteasy 统一的异常处理handler
- object c NSNumber
- CORBA通过IOR文件远程获取实现类
- 如何创造财富?硅谷创业之父 Paul Graham 《黑客与画家》思维导图
- MyEclipse8.6注册码亲测可用
- 死锁