Sunday, July 2, 2017

Background visible on fullscreen window

Leave a Comment

My WPF application (with Elysium Extra) has a margin on the right side of the window when I click the fullscreen button:

enter image description here

On the right side you can see my desktop background.

I checked if there is a margin, but it is set to 0 px on all sides. I have also set

this.MaxWidth = SystemParameters.MaximizedPrimaryScreenWidth; this.MaxHeight = SystemParameters.MaximizedPrimaryScreenHeight; 

App.xaml:

<extra:ElysiumApplication x:Class="CTS.App"              xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"              xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"              xmlns:extra="http://schemas.extra.com/ui"              xmlns:local="clr-namespace:CTS"              Theme="Dark"              StartupUri="MainWindow.xaml" /> 

MainWindow.xaml:

<extra:Window x:Class="CTS.MainWindow"         xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"         xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"         xmlns:d="http://schemas.microsoft.com/expression/blend/2008"         xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"         xmlns:extra="http://schemas.extra.com/ui"         xmlns:local="clr-namespace:CTS"         mc:Ignorable="d"         Title="..." Height="521.877" Width="1239.945" FontFamily="Open Sans" Foreground="#FF0970D1" Background="#FF22313F">  .... 

Edit: I have checked the Elysium Extra demo application. It also has the same problem, so it seems like it is caused by the Framework. However, I'd like to keep on using it.

How can I get rid of this margin?

1 Answers

Answers 1

Have a look at this: http://stackoverflow.com/a/24818071/4587181 It uses some Windows32 interop to set the Windows margins right. Because this problem also happens when you use your own custom Window chrome (WindowStyle = None), I experienced it. This SO answer solved it. Good luck

If You Enjoyed This, Take 5 Seconds To Share It

0 comments:

Post a Comment