I have a button which runs a job, let's replace the job with just a 'Sleep' for a few seconds. When clicking the button, the form's icon changes:
private void ButtonStartClick(object sender, EventArgs e)
{
this.Icon = Properties.Resources.RED_32x32_ICON;
System.Threading.Thread.Sleep(4000);
this.Icon = Properties.Resources.GRE_32x32_ICON;
}
This successfully changes the icon for the 'Form' that the button is on - but it's NOT changing the taskbar icon?!
I'm fairly sure I had something similar running in VB last year whereby changing the currently visible form icon would change the taskbar icon too. This was great for showing when my app was "busy"
I tried changing the default icon for my app and inheriting it, and also just applying my icon at form load...
private void MainForm_Load(object sender, EventArgs e)
{
// this.Icon = Icon.ExtractAssociatedIcon(Application.ExecutablePath);
// this.Icon = Properties.Resources.GRE_32x32_ICON;
}
There are a few related hits when googling this but mainly to do with just changing the icon via the app settings and not during run time?!