1
votes

I try to display a window in my application exactly in specified rectangle:

Left = 0, Top = 0, Width = 1920, Height = 240.

It seems to have left and right margin. And a bottom margin. Looks roughly like 8 pixels. Like the system refused to place the window where I told it to by specifying Left, Top, Width and Height properties.

However when I set WindowStyle to None and AllowsTransparency to True- it behaves properly.

But I don't need and I don't want borderless windows, I need normal system windows, but placed correctly. How to achieve it?

If the margins are the part of Windows UI and can't be removed - how to determine their sizes to take into account when placing windows?

I'm testing it with Windows 10 on desktop computer.

1

1 Answers

2
votes

It's cause there is no design border in windows 10 like windows 7. Use below code to set the Left property:

Left = 0 - SystemParameters.ResizeFrameVerticalBorderWidth - SystemParameters.FixedFrameVerticalBorderWidth;

your window's position will be right after this. Top should be already OK. Set Width equal to SystemParameters.WorkArea.Widththen there should be no margin to Right.