trayicon « Icon Image « Java Swing Q&A





1. "cannot create instance defined in assembly" when creating a new System.Drawing.Icon    stackoverflow.com

I am trying to create a system tray icon in WPF using the lines of code below:

System.Windows.Forms.NotifyIcon ni = new System.Windows.Forms.NotifyIcon();
ni.Icon = new System.Drawing.Icon("main.ico");
XAML:
> <Window x:Class="WpfExample.Window1"
>     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
> ...