I have a tray application that monitors Windows services. Depending on the status of the Windows Service, I change the application icon to either a green, orange or red LED.
My default application icon is the red LED (Project -> Options -> Application -> Icons).
All the icons change except the icon of the main form, that does not change. The following icons does change:
What do I need to do to get the main form icon to change?
I have even explicitly change the frmMain.Icon but that also did not work.
My code is simple and looks like this:
{set the application icon}
if FAppStatus = Error then
ImageList.GetIcon(2, Application.Icon)
else
if FAppStatus = Warning then
ImageList.GetIcon(1, Application.Icon)
else
ImageList.GetIcon(0, Application.Icon);
frmMain.Icon := Application.Icon;
I have tried different BorderStyles but that made no difference. I also played with Application.MainFormOnTaskbar without success.
Moderator: Please note that this question is not about the taskbar icon. The posts about the Taskbar icon did not resolve this issue.