VBA UserForm / Displaying/resizing images in a userform for diffrent display scalings

Young Grasshopper

Board Regular
Joined
Dec 9, 2022
Messages
58
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
Hello World,

I have this userform that implements a lot of images for design, buttens, animations etc.
Usually i connect my laptop to duel monitors that implements 100% display scaling, and i designed the whole thing in there. But quickly enough i learned that if i open excel and the userform when i just use the laptop display, that is usually in 125% display scaling, everything shifted.
This is of course because of the diffrent resolutions or whatever, and that's fine. My original plan was just to implement a code to get the users display resolution, then make two diffrent forms and load the right one.

But then i noticed that if i change my display scaling to 100% and open the workbook, then change the scaling back to 125% the text size and everything goes back to "normal", but the forms also load and is displayed correctly! Why is that?
It seems wierd to me that if you can "trick" the system that easy, the software should just scale userform and images to look the same everytime. Is there a way to use this anyway when loading forms, or is this just a happy side effect that I don't understand?

Not really looking for a solution, more an enlightenment of why this can be done;)
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK

Forum statistics

Threads
1,214,935
Messages
6,122,337
Members
449,077
Latest member
Jocksteriom

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top