Coding my project was going well. But today I noticed a problem.
My main notebook has full hd (1920x1080) resolution and I am coding my projects here. When I changed my main notebook's resolution to 1280x1024, 1280x800, or 1024x768 there is no problem. My application's resolution is 1024x768 and it is not collapsing. This is the printscreen.
But my other notebook has 1366x768 resolution. And I am running my application on this notebook. Oh! There is a disappointment. My application screen shifted. This is the bad printscreen.
I do not understand why. What can I do correcting this error?
It arises from different DPI settings. You can do this in the form load:
// Get DPI width
float x = this.CreateGraphics().DpiX;
// If screen is width
if (x == 120)
// Get big image from Resources
this.BackgroundImage = Properties.Resources.BigImage;
else
// Get small image from Resources
this.BackgroundImage = Properties.Resources.SmallImage;