I have used MDI in my Windows Form Application, it is not showing the application icon in taskbar

606 views Asked by At

I have a login form and then a master form which uses MDI. The master form inherits MetroForm. I have already set the icon in Window Style > Icon, ShowIcon as True, ShowInTaskbar as True for the master form. I have set the icon in MyApp > Properties > Application > Icon and manifest. Still it is not showing the icon in taskbar for the master form. Only the login form is showing the icon.

2

There are 2 answers

1
jason.kaisersmith On

As you start your APP into the login form, then this is considered the "main" form so the APP icon shows for this form. Because you then open another form (your master form) then this will not use the APP icon but its own icon. This is because each form also has its own icon.

So you need to set the icon for the form individually.

To do this in the form designer select your form, go to the properties and under the section ""WindowStyle" you will find an "Icon". Open this and select the icon you want to use.

enter image description here

1
Rohit Poudel On

Case 1: You need to give your form that icon as well. The application icon is the one that is embedded in the application and displayed in Explorer or on shortcuts. Each form can have its own icon, though.

Case 2: Set the Form.Icon Property through code also consider the below suggestion from MSDN

A form's icon designates the picture that represents the form in the taskbar as well as the icon that is displayed for the control box of the form. This property will have no effect if FormBorderStyle is set to FixedDialog. In that case, the form will not display an icon.