I'm trying to create a WPF window, which has no icon and no title displayed in the titlebar.
I already found some examples how the icon can be removed (for example here), but all these solutions work if I'm debugging the application in Visual Studio but they don't work when I'm just running the executable.
I would also like the title not to be shown. Of course I could leave th开发者_运维百科e title blank, but I would like the title to be disyplayed in the taskbar (similiar to what Windows Explorer does in Vista/7)
You can do this from visual studio like this :
Alternatively set style for the window to none using :
<Window WindowStyle="None">
try this :-
<Window WindowStyle="None">
what you get is a chromeless window, this has no titilebar or icon, but you still get one in the taskbar. then you completely style the window yourself. (you could make it look like iTunes for example) faking up a blank title bar should be really easy. much simpler than messing with the interop code. and it gets done all in xaml
look here for how to implement a chromeless window
In this post: http://blogs.msdn.com/wpfsdk/archive/2008/09/08/custom-window-chrome-in-wpf.aspx
Look for the section titled "Vista Explorer – Removing redundant information from the title bar"
Faking a blank title bar is only easy if you don't do it right (you have to match the current Windows theme, handle the "glass" effect, window resize handles, window move drag&drop, double-click on the title bar, etc.)
精彩评论