The thing to understand about window borders is that they are special, in the sense that they work a bit differently from the rest of WPF. The reason for this is that the window border is at the edge where the classic Win32 world meets the new WPF world.
In XP at least, the default window border is essentially a Win32 thing. (The story is a little more complex in Vista if you have glass. But the fact remains that the window border is handled differently from the contents of the window.)
The first question I need to ask is this: are you turning the default window 'chrome' off (I.e. are you disabling the usual title bar, resize borders, and so on.) If you're not, then there's only a limited amount you can do to control the shape of these, and it's probably a bad idea to try to do so.
But for now, I'll assume that you've turned these off, and that the reason you want to change the window shape is because you're creating your own custom look for the window.
The technique for controlling the shape of your windows is to exploit transparency. Basically, you render the contents in whatever shape you like, leaving the rest transparent, and voila: shaped window.
Nathan Dunlap shows an example of how to do this:
http://www.designerslove.net/2006/03/non-rectangular-windows.html
This is actually much more powerful than the approach you're looking for would be. A border radius would just let you round off the edges. But the technique Nathan shows here lets you create windows of any shape you like. (And they will have nice anti-aliased edges. And you can even use transparency.)
|