WPF Icon System.Drawing.Icon

jujudodo5649855

New member
Joined
Aug 5, 2008
Messages
1
Programming Experience
1-3
Hi all, I am creating an app with WPF. In this app when a child window is opened the main window minimizes and show a NotifyIcon. This I have working, however my problem is that in VS 2008 I use the absolute path for the notifyicon (i.e. c:\\Documents and....myicon.ico), which is he only way that works (I am doing the is VB not xaml) but when the app is published and installed on anther computer, I get the cnt find part of the path exception. So I used the pack syntax (pack://application:,,,/Resources/myicon.ico. This way throws exceptions in VS 2008 debug and the published/installed version (the exception is "The given path's format is not supported"). Can somebody tell me what I am doing wrong. The same icon file is being used for the Application icon as well as the Window icon and those work. It is just the System.Drawig.icon that wont work.

nIcon.Icon = New Icon("pack://application:,,/Resources/myIcon.ico")

Regards
 
Why don't you keep the icon in a directory below that of the application, and use
nIcon.Icon = New Icon("/Icons/myIcon.ico")
 
Back
Top