Stop Images from moving on a Userform

Sharid

Well-known Member
Joined
Apr 22, 2007
Messages
1,057
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

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.

NdNoviceHlp

Well-known Member
Joined
Nov 9, 2002
Messages
2,791
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
 

Sharid

Well-known Member
Joined
Apr 22, 2007
Messages
1,057
Office Version
  1. 2016
Platform
  1. Windows
Images are in a image control
 

NdNoviceHlp

Well-known Member
Joined
Nov 9, 2002
Messages
2,791
Have you tried running the resize image control routine and then re-loading the image to fit the control? Dave
 

Sharid

Well-known Member
Joined
Apr 22, 2007
Messages
1,057
Office Version
  1. 2016
Platform
  1. Windows
No, not sure what that is, is it in the properties
 

NdNoviceHlp

Well-known Member
Joined
Nov 9, 2002
Messages
2,791
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
 

Forum statistics

Threads
1,136,954
Messages
5,678,758
Members
419,782
Latest member
gc75150

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
Top