扫一扫
分享文章到微信
扫一扫
关注官方公众号
至顶头条
作者:阿虎 来源:Yesky 2007年11月14日
关键字:
private Icon mNetTrayIcon = new Icon ( "Tray.ico" ) ; |
TrayIcon.Icon = mNetTrayIcon ; |
TrayIcon.Text = "用Visual C#做托盘程序" + "\n" + "作者:马金虎于2001.12.08" ; |
notifyiconMnu = new ContextMenu ( mnuItms ) ; TrayIcon.ContextMenu = notifyiconMnu ; //为托盘程序设定菜单 |
//定义一个MenuItem数组,并把此数组同时赋值给ContextMenu对象 MenuItem [ ] mnuItms = new MenuItem [ 3 ] ; mnuItms [ 0 ] = new MenuItem ( ) ; mnuItms [ 0 ] .Text = "用Visual C#做托盘程序!" ; mnuItms [ 0 ] .Click += new System.EventHandler ( this.showmessage ) ; mnuItms [ 1 ] = new MenuItem ( "-" ) ; mnuItms [ 2 ] = new MenuItem ( ) ; mnuItms [ 2 ] .Text = "退出系统" ; mnuItms [ 2 ] .Click += new System.EventHandler ( this.ExitSelect ) ; mnuItms [ 2 ] .DefaultItem = true ; notifyiconMnu = new ContextMenu ( mnuItms ) ; TrayIcon.ContextMenu = notifyiconMnu ; //为托盘程序加入设定好的ContextMenu对象 |
如果您非常迫切的想了解IT领域最新产品与技术信息,那么订阅至顶网技术邮件将是您的最佳途径之一。