托盘控件和微软图表控件
来源:互联网 发布:js object对象 编辑:程序博客网 时间:2024/06/16 19:27
1.托盘控件代码示例:
在窗体加入notifyIcon控件,示例代码,点击托盘左键弹出窗体:
public partial class Form1 : Form { private bool isClose; public Form1() { InitializeComponent(); ContextMenuStrip cms = new System.Windows.Forms.ContextMenuStrip(); ToolStripMenuItem startItem = new ToolStripMenuItem(); startItem.Text = "开始"; startItem.Image = Properties.Resources.Skype_16; startItem.Click += new EventHandler(startItem_Click); cms.Items.Add(startItem); ToolStripMenuItem stopItem= new ToolStripMenuItem(); stopItem.Text = "终止"; stopItem.Image = Properties.Resources.Head_OffLine; stopItem.Click += new EventHandler(stopItem_Click); cms.Items.Add(stopItem); ToolStripMenuItem exitItem = new ToolStripMenuItem(); exitItem.Text = "退出"; exitItem.Image = Properties.Resources.Head_OffLine; exitItem.Click += new EventHandler(exitItem_Click); cms.Items.Add(exitItem); notifyIcon.ContextMenuStrip = cms; } void startItem_Click(object sender, EventArgs e) { } void stopItem_Click(object sender, EventArgs e) { } void exitItem_Click(object sender, EventArgs e) { isClose =true; Close(); } private void Form1_FormClosing(object sender, FormClosingEventArgs e) { if(!isClose) { e.Cancel=true; this.Visible = false; this.notifyIcon.Visible = true; } } private void notifyIcon_Click(object sender, EventArgs e) { if ((e as MouseEventArgs).Button == MouseButtons.Left) { this.Visible = true; } } }
实现的效果:
2.微软的图表控件,chart控件
实现效果如下:
教程可参照博客http://www.cnblogs.com/shuncy/archive/2008/11/07/1328738.html
0 0
- 托盘控件和微软图表控件
- 微软图表控件MsChart
- 微软图表控件MsChart
- 微软图表控件MsChart使用
- 微软图表控件MsChart使用说明
- 微软图表控件MsChart使用指南
- 微软图表控件MsChart画图
- 微软图表控件MsChart使用
- WPF自定义控件-托盘控件和事件
- 托盘控件
- 微软图表控件MsChart使用初探
- 微软Chart控件导学--渲染图表
- 微软图表控件MsChart使用初探
- 微软图表控件MsChart使用初探
- 微软图表控件MsChart使用初探
- 微软Chart控件导学--渲染图表
- 微软图表控件MsChart使用初探
- 微软图表控件MsChart使用初探
- 事件传播
- fzuoj 2142 Center of a Tree
- 设置Android模拟器上网的方法
- 机器学习-----K近邻算法
- fedora 20 软件
- 托盘控件和微软图表控件
- Josephu问题链表方法
- Java jdk 环境变量 配置 详解
- NSJSONSerialization
- Java命令模式(Command模式)
- More Morphology Transformations
- 百度LBS云端数据库数据导入几个注意的地方
- mono for Android截获短信
- 深入理解Hadoop YARN中的Container概念