Stop Images from moving on a Userform

Sharid

Well-known Member
Joined
Apr 22, 2007
Messages
1,064
Office Version
  1. 2016
Platform
  1. Windows
I am using images on a userform as buttons instead of command buttons, the problem I am having is that the images slightly move depending on the users screen size. Is there a way to prevent this from happening, so their position is fixed, I have have tried "to grid" that did not help.

I am also using this code in the form Jaafar Tribak's code userform resize


From thisTo this when it moves
1612539257165.png
1612539408298.png
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
What are the images contained within... an image control, button face, frame etc.? Anyways, I think you need to first resize the control and then re-fit the image to the control. HTH. Dave
 
Upvote 0
Images are in a image control
 
Upvote 0
Have you tried running the resize image control routine and then re-loading the image to fit the control? Dave
 
Upvote 0
No, not sure what that is, is it in the properties
 
Upvote 0
Seems reasonable to trial this after your resize routine (adjust to suit). Dave
Code:
With Userform1.Image1
'Load Picture to Image Control
.Picture = LoadPicture(YourFilePath)
'Align the Picture Size
.PictureSizeMode = fmPictureSizeModeZoom
End With
 
Upvote 0

Forum statistics

Threads
1,214,643
Messages
6,120,707
Members
448,981
Latest member
recon11bucks

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