1

So i got some code which is suposed to make a picture box stay the same size as the window.

I was trying to use px.Dock = DockStyle.Fill but that only filled the tope left quarter of the window.

I tried to use the ClientSize variable, the Size variable etc of the window.

Then i noticed that the window detected itself as 1721 pixel wide, when maximized... My monitor is 3840 pixels wide so that cannot be true.


Debug.WriteLine("Window: " + f.Size);

Prints:
Window: {Width=1727, Height=980} (when maximized)

Any help appreciated!

  • A non-DpiAware application receives *virtualized* measures. If possible, change the target .Net version to .Net 6 instead of .Net Framework. Otherwise, make your application DpiAware yourself. If you're targeting .Net Framework 4.7.2 or 4.8, use `app.config` to set `PerMonitorV2` as the DpiAware mode – Jimi Sep 24 '22 at 12:23

0 Answers0