I am writing an on-screen keyboard with multiple layouts, i.e. multiple forms in one project, with Winforms under c++/CLI, instead of C#.
The user can select the layout by selecting a language in a dropdown list, which exists in each form, and each change results in closing the current form and opening the corresponding new form (new keyboard layout). These forms do not necessarily have to have their own icon, but I want one icon for the entire programme rather than for each form. So in the constructor of each form I have:
this->Icon = gcnew System::Drawing::Icon("example.ico");
This should set up the icon in the taskbar, nevertheless, there is no icon in the taskbar except for the following weird scenarios:
- When I select the same language twice, then the icon pops up in the taskbar.
- I tried to debug the programme and added the breakpoint at
Application::Run(Keyboard);
, and I accidentally found that the icon is now visible at the first time the form is opened, but not twice anymore as in the last scenario.
Any idea what I should do to make the icon always visible in the taskbar?