Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I implement a chromeless window with WPF?

Tags:

I want to show a chromeless modal window with a close button in the upper right corner. Is this possible?

like image 613
FantaMango77 Avatar asked Sep 01 '08 12:09

FantaMango77


People also ask

What is Chromeless window?

Customizable window that enriches your application's UI. Style the window by modifying the border, corner radius, and in-build visual styles. Add custom controls on either side of the title bar.

How do you call a window in WPF?

Step 1: Create an empty WPF using Visual Studio, enter the name for the application and click on OK. Step 2: Create a button using the following code or drag and drop a button from the ToolBox of Visual Studio 2013.

What is the difference between WPF window and WPF page?

Window is the root control that must be used to hold/host other controls (e.g. Button) as container. Page is a control which can be hosted in other container controls like NavigationWindow or Frame. Page control has its own goal to serve like other controls (e.g. Button). Page is to create browser like applications.


2 Answers

You'll pretty much have to roll your own Close button, but you can hide the window chrome completely using the WindowStyle attribute, like this:

<Window WindowStyle="None"> 

That will still have a resize border. If you want to make the window non-resizable then add ResizeMode="NoResize" to the declaration.

like image 51
Matt Hamilton Avatar answered Dec 18 '22 09:12

Matt Hamilton


Check out this blog post on kirupa.

alt text

like image 21
Alan Le Avatar answered Dec 18 '22 09:12

Alan Le