0

In WPF, whenever I set WindowState to Maximized, I get a full screen without border. How to get a full screen with border, like the one shown in the image.

This image is of Windows File Explorer(with border) and is only shared to show the borders. It has nothing to do with my application.

I want my WPF window to have similar borders when maximized.

  • 1
    My file explorer expands the same as my WPF.. – BugFinder Jun 21 '17 at 10:01
  • I shared the File Explorer window just to show windows7 supports 2 types of full screen. One with border and other without Border. Kindly, unplug your monitor adapter and replug to see the difference. – Muralikrishnan Ramanathan Jun 21 '17 at 10:07
  • 2
    To me this seems not to be an issue with WPF but seems to be an indication of an issue with your Windows 7 installation. (Suggestion: Install a vanilla Windows 7 in a VM, and try your program there and compare the behavior of the vanilla Win7 installation with your current Win7 installation). –  Jun 21 '17 at 10:15
  • Set the window height and width to screensize... see: https://stackoverflow.com/a/2118993/2289942 – Nawed Nabi Zada Jun 21 '17 at 10:23
  • @MuralikrishnanRamanathan Im sorry but Im not going to unplug a monitor just because you think your bug will show. – BugFinder Jun 21 '17 at 11:25
  • Hi BugFinder, Please check the 2 screens. https://social.msdn.microsoft.com/Forums/Windowsdesktop/en-US/078c613a-a11c-4ddc-a792-84315ce875f4/in-windows7-when-window-is-maximized-it-does-not-show-border?forum=windowsgeneraldevelopmentissues – Muralikrishnan Ramanathan Jun 21 '17 at 11:50
  • How does that link help the question - you have already shown the picture with border in your question, we know what it looks like without the border? – PaulF Jun 21 '17 at 12:25
  • Hi Paul, I thought I didnt convey the question clearly, since the image without border was not shared. – Muralikrishnan Ramanathan Jun 21 '17 at 12:59
  • @BugFinder All I need is the method call to do both. I did not say the one with the border is a bug. Did I? WindowState.Maximized will maximize it to a borderless window. If you assign height and width of the work area/ monitor area of the screen, it will still show a borderless window. – Muralikrishnan Ramanathan Jun 21 '17 at 14:41

1 Answers1

0

because WindowState does not control the border at all. use WindowStyle for that. full screen without border would be WindowStyle.None sounds like you want WindowStyle.SingleBorderWindow

Bengineer
  • 21
  • 5