c#notifyIcon 托盘
来源:互联网 发布:淘宝拍卖烂尾楼 编辑:程序博客网 时间:2024/05/16 14:57
代码部分:
private void Form1_Resize(object sender, EventArgs e) { //判断是否选择的是最小化按钮 if (WindowState == FormWindowState.Minimized) { //隐藏任务栏区图标 this.ShowInTaskbar = false;//必须要有,否则会出问题 //图标显示在托盘区 notifyIcon1.Visible = true; this.Hide(); } } private void notifyIcon1_MouseDoubleClick(object sender, MouseEventArgs e) { if (this.WindowState == FormWindowState.Minimized) { WindowState = FormWindowState.Normal; //激活窗体并给予它焦点 this.Activate(); //隐藏任务栏区图标 this.ShowInTaskbar = true;////必须要有,否则会出问题 //图标显示在托盘区 notifyIcon1.Visible = false; this.Show(); } } private void tsmi显示窗口_Click(object sender, EventArgs e) { notifyIcon1_MouseDoubleClick(null, null); }
界面设置:
1 添加NotifyIcon 和 ContextMenuStrip
2 使用NotifyIcon的ContextMenuStrip属性关联ContextMenuStrip
NotifyIcon属性面板 可以设置ICON, 右下角显示的图标
窗体form设置属性,showIcon=fasle;showInTaskBar=fasle;
0 0
- c#notifyIcon 托盘
- C#NotifyIcon类把程序最小化到右下角托盘
- C#.NET常见问题(FAQ)-如何使用右下角托盘图标notifyIcon
- NotifyIcon实现托盘程序
- NotifyIcon实现托盘程序
- NotifyIcon实现托盘程序
- Notifyicon 托盘 简单使用
- 托盘图标(NotifyIcon)详解
- NotifyIcon控件 托盘控件
- 托盘控件notifyicon恢复窗体
- 托盘控件(NotifyIcon)恢复窗体
- NotifyIcon(托盘的实现)
- MFC使用NotifyIcon托盘应用程序
- C# 托盘图标. notifyIcon 用法
- MFC实现NotifyIcon托盘应用程序
- 使用NotifyIcon控件创建任务栏托盘
- C#如何使用右下角托盘图标notifyIcon
- Winform托盘NotifyIcon使用(类似QQ消息提示)
- Myeclipse 2016 SVN插件突然缺失的解决办法
- servlet之初认识
- 堆栈
- LeetCode053 Maximum Subarray
- 经典排序算法
- c#notifyIcon 托盘
- 最大子数组之和
- [阈值] SPOJ RECTANGL
- 使用指针时,容易出错的几个地方
- L1-026. I Love GPLT
- 阿里云https证书tomcat配置
- Machine Learning多元线性回归算法及优化
- 004-107-Binary Tree Level Order Traversal II 层序遍历二叉树之二
- 记SDOI2017 Round 1