Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/312.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 如何在BallootTipClick事件后打开url_C#_Notifications_Event Handling_Notifyicon - Fatal编程技术网

C# 如何在BallootTipClick事件后打开url

C# 如何在BallootTipClick事件后打开url,c#,notifications,event-handling,notifyicon,C#,Notifications,Event Handling,Notifyicon,在用户单击NotifyIcon后,如何打开url 这是我的密码 public void shownotification(字符串消息、字符串url) { var notification=new System.Windows.Forms.NotifyIcon() { 可见=真, Icon=System.Drawing.SystemIcons.Information, //可选-balloottipicon=System.Windows.Forms.ToolTipIcon.Info, //可选-b

在用户单击
NotifyIcon
后,如何打开
url

这是我的密码

public void shownotification(字符串消息、字符串url)
{
var notification=new System.Windows.Forms.NotifyIcon()
{
可见=真,
Icon=System.Drawing.SystemIcons.Information,
//可选-balloottipicon=System.Windows.Forms.ToolTipIcon.Info,
//可选-balloodtiptitle=“我的标题”,
BalloadTiptText=消息,
};
notification.balloottipclicked+=新的EventHandler((发送方,e)=>OpenChrome(url));
通知。展示气球提示(5000);
}
公共无效OpenChrome(字符串url)
{
流程=新流程();
process.StartInfo.FileName=@“C:\ProgramFiles(x86)\Google\Chrome\Application\Chrome.exe”;
process.StartInfo.Arguments=url+“--new window”;
process.Start();
}
显示通知,但从未调用OpenChrome方法


如何修复它?

尝试将其更改为:

notification.Click += new EventHandler((sender, e) => OpenChrome(url));
与此相反:

notification.BalloonTipClicked += new EventHandler((sender, e) => OpenChrome(url));
然后浏览器将打开