Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 992
Shimmy Weitzhandler Avatar asked Mar 17 '09 15:03

Shimmy Weitzhandler


People also ask

How can you created rounded corners?

To create a rounded corner, we use the CSS border-radius property. This property is used to set the border-radius of element.


1 Answers

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

like image 164
CodeMonkey1313 Avatar answered Oct 05 '22 23:10

CodeMonkey1313