My company has a branding mechanism that sets the icon for a Windows Application, like so:
if (AppBranding.Is("FOO"))
Icon = MyProject.Properties.Resources.Icon_FOO;
else
Icon = MyProject.Properties.Resources.Icon_BAR;
Icon_FOO
and Icon_BAR
are resources that point to their respective .ico files.
Also, Icon and manifest in Project > MyProject Properties > Resources is set in Visual Studio.
When users launch the application, the correct icon appears based on branding. However, if they pin the program to the taskbar, the icon reverts to Icon_FOO.ico, regardless of branding. When they unpin it, the icon toggles back.
I believe that programs pinned to the taskbar use the icon of the .exe, while the icon for the Window is whatever I set Form.Icon
to be. I only know how to set the .exe icon by going to Project Properties > Resources and making a selection from the drop down list, as I have in the picture above. How can the icon for the .exe be set dynamically?