Hello. There is a message box in the program type:

MessageBox.Show("Имеется новая версия программы. Обновить?", "Внимание", MessageBoxButtons.OKCancel, MessageBoxIcon.Information) 

Using MessageBoxIcon.Information I set the icon for the notification window itself. The icon is in the window. But when you start the window, a very ugly (standard) picture appears in the taskbar. I need to change it. How to do it?

  • But when you start the window, a very ugly (standard) picture appears in the taskbar - attach a picture of something that does not suit you. Little is not clear what is wrong. - Denis Bubnov
  • one
    MessageBox is not displayed in the taskbar, it is obvious that he has nothing to do with it, and the taskbar in the taskbar belongs to the form of the application, change the icon there and enjoy the beautiful icon. Just find the desired form property; it is even displayed in the constructor. - rdorn

2 answers 2

MessageBox is a modal information window, it is not displayed in the taskbar, because blocks the operation of the application and can be hidden only by another application, so a separate button for MessageBox on the taskbar is simply not necessary.

The taskbar icon belongs to the main form of the application. Set the icon in the property Form.Icon . A standard set of icons, besides a typical stub with squares, is not provided for this property, you need a special *.ico icon file, and yes, it differs not only in its extension but also in its format, so just rename, for example *.jpeg or *.bmp to *.ico not work.

If there are other forms in the application that start with the display on the taskbar, then they also need to define an icon, otherwise the default cap with squares will be used.

    If I am not mistaken, the window icon (the window, not on the message form) when calling MessageBox.Show() is taken from the application icon. Try to enter the project properties (In the Project -> Properties menu, then the Application tab, there is an Icon and manifest section, select the icon for your application as a whole.

    Should help.

    Calling properties through the menu

    Specify application icon

    • This is an exe-shnik icon. The icon for the taskbar is set in each form individually. And MessageBox is not displayed at all in the taskbar - rdorn