How can I make a rounded-corners form in WPF?

Shimmy Weitzhandler picture Shimmy Weitzhandler · Mar 17, 2009 · Viewed 41.8k times · Source

I am trying to make the corners of a Window (WPF) rounded and it doesn't work, I tried to make the window itself transparent and add an internal border with rounded corners and it doesn't work.

Any ideas?

Answer

CodeMonkey1313 picture CodeMonkey1313 · Mar 17, 2009

you need to set WindowStyle to WindowStyle.None, which will remove the chrome, then you can allow transparency which is an attribute int the Window element, and set the background color to transparent. All of this can be done as attributes to the window tag.

WindowStyle="None"
AllowsTransparency="True"
Background="Transparent"

To make the corners rounded, use a border and set the cornerRadius property