obj.DoubleClick += new EventHandler(aa_Click(sender,e,i);//这里加入参数就会报错这里你要注册NotifyIcon 对象的双击事件, new EventHandler(aa_Click); 这里只能传方法名,不能传参数进去。还有EventHandler只支持两个参数(object sender, EventArgs e)所以 private void aa_Click(object sender, EventArgs e,int i) { Process p = new Process(); p.StartInfo.FileName = @dgvSoft.Rows[i].Cells[6].Value.ToString(); p.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;p.Start(); }这个方法的,int i参数必须去掉。其实我想到个方法,你不需要传这个参数的你可以把这个参数保存到NotifyIcon 对象的Tag中触发 aa_
Click事件时,你可以从 NotifyIcon a =(NotifyIcon )sender;int i = Convert.ToInt32(a.Tag);这样一样可以取到的,有疑问继续问我!