3

VB .Net 2.0

I am trying to change the NotifyIcon's icon, but it only work while debugging. If I copy the .exe for other folder than Debug/Release, it's doesn't work anymore. It's sounds like a "missing file". But the icons are set to "Embedded in .resx", and the Resource.resx is set to "Embedded Resource". So I don't think it is missing files.

I already try with

         NotifyIcon1.Icon = My.Resources.MyIcon

         NotifyIcon1.Icon = 
         Drawing.Icon.FromHandle(My.Resources.MyIcon.Handle) 

    NotifyIcon1.Icon =New _ 
Icon(System.Reflection.Assembly.GetExecutingAssembly.GetManifestResourceStream("assembly.MyIcon"))

After any of those tries, the icon stay the same what was configured at design time.

Thanks.

lcssanches
  • 995
  • 12
  • 33
  • Is there a `.resx` file in your `bin\debug` folder? If you copy that with it does it work? – Jeff B May 29 '13 at 22:34
  • No. But we solve the problem. I don't know why, but .Net Framework wasn't throwing an Exception and just stop the execution of the method because a missing DLL. – lcssanches Jun 03 '13 at 11:16

1 Answers1

0

The first one should work if you set the resource to "Linked at compile time" instead of "Embedded in .resx".

Joe
  • 101
  • 10