Wpf Notifyicon未在Windows XP中显示
嘿,
我的代码遇到了很大的问题,在开发过程中我刚刚测试了Windows 7和10系统上的程序。
现在客户希望它也可以在Windows XP机器上使用,基本上是为.Net3.5编写的,与大多数系统兼容。
在我的Windows XP物理测试机上,我我已经安装了net 3.5但是我的taskbarnotifyicon,我正在使用hardcodet.net上的流行库(V1.0.4.0 for .net 3.5),图标不可见。只有一个空白区域应该是,但是没有显示图标,即使没有鼠标悬停文本和上下文菜单也没有。
我到目前为止调试了程序,问题是基于icon.
Hey,
I've got a huge problem with my code, while developing I just tested the program on Windows 7 and 10 systems.
Now the customer wants it to be used also on Windows XP machines, basically its written for .Net3.5, to be compatible with most systems.
On my Windows XP physical testmachine, I've got net 3.5 installed but my "taskbarnotifyicon", I'm using the popular library from hardcodet.net (V1.0.4.0 for .net 3.5), the icon is not visible. There is just a blank space, where it should be but no icon is displayed, even no mouseover-text and contextmenu is not available.
I debugged the program so far, that the problem is based on the icon.
Info Infofenster = new Info();
ContextMenu conMen = new ContextMenu();
MenuItem Info = new MenuItem();
public App()
{
//other source, blabla
}
protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);
//some code, Database etc.
Info.Click += OpenInfo;
Info.Header = "Info";
conMen.Items.Add(Info);
icon = new TaskbarIcon();
icon.Icon = AmpelStempelzeit.Properties.Resources.ledAnwesend;
icon.ToolTipText = "Eingestempelt";
icon.Visibility = Visibility.Visible;
icon.TrayPopup = new Popup(icon);
icon.ContextMenu = conMen;
}
protected override void OnExit(ExitEventArgs e)
{
icon.Dispose();
base.OnExit(e);
}
在Windows 7,8,10上运行效果很好,可能WinXp无法处理资源路径 对于图像?
我真的不知道。
来自白雪皑皑的德国,
Vince
Running on Windows 7, 8, 10 works great, probably WinXp cant handle the "Resourcepath" for images?
I really have no idea.
Regards from snowy Germany,
Vince
将其缩放到150 * 150,现在它就像魅力一样。
Scaled it to 150*150 and now it works like a charm.