Hi everyone. I'm trying to do (in WPF):
- Have an .exe file that displays the system menu icon (the icon in the upper left of the window) like normal
- Not have this icon show up in modal windows called by this app
I tried the solution here: http://stackoverflow.com/questions/2341230/removing-icon-from-a-wpf-window
And this worked. There's a downloadable sample of the same thing at: http://blogs.msdn.com/b/wpfsdk/archive/2007/08/02/a-wpf-window-without-an-window-icon-the-thing-you-click-to-get-the-system-menu.aspx
However, it stops working if I add an .ico file to the .exe's project properties (Properties -> Application -> Icon and Manifest). You can try this with the downloadable sample.
It seems that the icon from the .exe is used in the modal windows too (which we have in .dll files) even if the properties of that .dll says "default icon". It must get passed down from the .exe. So, is there a way to show the icon on the main window, but not on a child window?
Possibly, an easier way of asking this is: Is it possible to remove the icon even though there's an .ico file specifies in the project's properties?
The only thing I've found to work is to set the WindowStye of the modal window to "ToolWindow". This gives me almost what I want: no icon and the "Close" button ("x" in upper right) is still there. Yet, the x is super small. Is this the best there is?
Thanks for any help.