c# - WPF and WIndows 10. Invisible border around windows? -


when tried align window side or corner of display, discovered there kind of padding between edge of screen , edge of window. had created new wpf project template, added 2 lines in constructor , got this:



why don't fit edge of screen? same problem when try put window right bottom corner this:

rect workarea = systemparameters.workarea; left = workarea.location.x + workarea.width - width; top = workarea.location.y + workarea.height - height; 

it looks window has 7px border (just on win7) invisible on win10. found if set both windowstyle windowstyle.none , resizemode resizemode.noresize, system places window correctly, not need. on win7 same program works expected.

of cource can set left property -7, not solution. how can set window place, on both win7 , win10?

the resizable border on left/right/bottom invisible on windows 10, , border gap is. if put window in middle of screen, , drag mouse left edge of window, see cursor change resizing cursor 8 pixels further out past edge of window. tells border still exists.

you can offests using combination of normal getwindowrect function , use of dwmgetwindowattribute function, dwmwa_extended_frame_bounds parameter.


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -