Reputation: 3317
I have a Form which I show with ShowDialog. I explicitely set the icon for the form with:
using (frmActivation myActivationView = new frmActivation())
{
myActivationView.ShowInTaskbar = true;
myActivationView.Icon = Properties.Resources.icon;
myActivationView.ShowDialog();
}
And I also set it in the project properties in the application tab as mentionend here:
Even though I have set ShowInTaskbar explicitely to true, it will show me the wrong icon.
I'm out of ideas what else could be the reason that it won't show the set icon?
Upvotes: 3
Views: 1847
Reputation: 343
It's not enough to set ShowInTaskbar
. You must also make sure that the property ShowIcon
of the form is set to true.
Based on the screenshot of your form and the fact, I can't see an icon in the upper left corner, I guess you haven't set it yet.
From the MSDN: Form.ShowIcon Property
The ShowIcon property contains a Boolean value that indicates whether the form's Icon is displayed in the caption bar of the form. If the ControlBox property is false, both the icon and control box will be suppressed.
If ShowIcon is false when the primary form is shown, a generic icon will be displayed in the taskbar button for the application.
Upvotes: 9