0

如何加载图标?

这是我的应用程序的构造函数:

public MyApp()
{
   this.InitializeComponent();
   Icon icon = new Icon(@"/icons/tray.ico");
   // Icon is instance of 'System.Drawing.Icon'
}

启动时,它会因以下异常而死:

Additional information: 'The invocation of the constructor on type 'Locale.MyApp' that matches the specified binding constraints threw an exception.' Line number '5' and line position '9'.

是的,图标存在(位于“/icons/tray.ico”)。这个错误并没有告诉我任何事情。

4

0 回答 0