问题描述
C#.net如何为软件添加任务栏右下角的小图标?
解决方案
解决方案二:
使用NotifyIcon控件。
解决方案三:
1、从工具箱找N开头的控件:NotifyIcon2:代码如下//添加右下角小图标的图片样式this.notifyIcon1.Icon=newIcon("C:\Users\Administrator\Desktop\house.ico");//显示托盘图标3秒this.notifyIcon1.ShowBalloonTip(3000,"提示","程序已经启动...",ToolTipIcon.Info);
解决方案四:
引用楼主lanbing8023的回复:
C#.net如何为软件添加任务栏右下角的小图标?
用NotifyIcon这个控件然后设置这个控件的图标。
解决方案五:
添加NotifyIcon这个组件后privatevoidnotifyIcon1_MouseDoubleClick(objectsender,MouseEventArgse){//添加右下角小图标的图片样式this.notifyIcon1.Icon=newIcon("C:\Users\Administrator\Desktop\house.ico");//显示托盘图标3秒this.notifyIcon1.ShowBalloonTip(3000,"提示","程序已经启动...",ToolTipIcon.Info);右下角没托盘图标啊引用2楼ghypnus的回复:
1、从工具箱找N开头的控件:NotifyIcon2:代码如下C#code//添加右下角小图标的图片样式this.notifyIcon1.Icon=newIcon("C:\Users\Administrator\Desktop\house.ico");//显示托盘图标3秒this.notifyIcon1.ShowBalloonTip(3000,"提示",……
解决方案六:
引用4楼lanbing8023的回复:
添加NotifyIcon这个组件后privatevoidnotifyIcon1_MouseDoubleClick(objectsender,MouseEventArgse){//添加右下角小图标的图片样式this.notifyIcon1.Icon=newIcon("C:\Users\Administr……
用法参考NotifyIcon
解决方案七:
完整代码,要拖一个notifyIcon1到窗体中privatevoidtsmiExit_Click(objectsender,EventArgse){this.FormClosing-=newSystem.Windows.Forms.FormClosingEventHandler(this.frmMain_FormClosing);Application.Exit();}privatevoidfrmMain_FormClosing(objectsender,FormClosingEventArgse){e.Cancel=true;//notifyIcon1.ShowBalloonTip(3000,"程序最小化提示",//"图标已经缩小到托盘,打开窗口请双击图标即可。",//ToolTipIcon.Info);this.Hide();}privatevoidfrmMain_FormClosed(objectsender,FormClosedEventArgse){notifyIcon1.Dispose();System.Environment.Exit(System.Environment.ExitCode);this.Dispose();}privatevoidnotifyIcon1_MouseDoubleClick(objectsender,MouseEventArgse){this.Activate();//激活当前程序为活动窗口this.ShowInTaskbar=true;this.WindowState=FormWindowState.Normal;this.Show();}