我在项目属性中为WPF应用添加了一个图标.
如何引用该图标,以便将其添加到我为系统托盘创建的NotifyIcon中.
在代码中??
System.Windows.Forms.NotifyIcon ni = new System.Windows.Forms.NotifyIcon(); ni.Icon = new System.Drawing.Icon("MyIcon.ico");
不行.马尔科姆
System.Windows.Forms.NotifyIcon ni = new System.Windows.Forms.NotifyIcon(); ni.Icon = System.Drawing.Icon.ExtractAssociatedIcon( System.Reflection.Assembly.GetEntryAssembly().ManifestModule.Name); ni.Visible = true;