65.9K
CodeProject is changing. Read more.
Home

Remove border from right and bottom of WPF full-screen window

starIconstarIconstarIconstarIconstarIcon

5.00/5 (3 votes)

Sep 23, 2010

CPOL
viewsIcon

29971

Creating a full-screen window in WPF is quite simple, set WindowState to Maximized and WindowStyle to None. However, a border is still visible on the bottom and on the right sides. In this post we'll discover how to remove it.

Creating a full-screen window in WPF is quite simple, you just have to set WindowState to Maximized and WindowStyle to None. But in my current project, I was facing a little drawback: a border was still visible on the bottom and on the right side of my window. An image example can be seen here: Image example[^] I have seen some solution on the web talking about Win32 interop and WM_GETMINMAXINFO messages, but is quite simplier :) : just set the ResizeMode attribute of your Window to NoResize. You will then end up with this windows:
<Window x:Class="lexiqueDuNet.com.Window1"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
       WindowState="Maximized" WindowStyle="None"  ResizeMode="NoResize" >
</Window>
PS : You can read this tip on my blog[^] too.