Pictures on modeless windows
Jos,
I set up UserForm1. I used the Image tool in the Toolbox, and made Image1.
I used to following code to show a modeless UserForm:
UserForm1.Show xlModeless
UserForm1.Image1.PictureSizeMode = fmPictureSizeModeZoom
To put focus back on the sheet, either or both of these:
'Sheets("Sheet1").Activate
'Sheets("Sheet1").Range("A2").Select
Then to change the picture, at any time:
PictureName = "C:\C5.jpg"
UserForm1.Image1.Picture = LoadPicture(PictureName)
It didn't deform the picture.
--
Earl Kiosterud
mvpearl omitthisword at verizon period net
-------------------------------------------
"Jos Vens" wrote in message
...
Hi,
I have a sheet with the names of my students. I let the user see a
picture of them on a modeless window (so cells can still be modified). To
see the form with the picture, a button must be pressed on the toolbar.
Q1: when the form is displayed, how can I give back focus on the sheet
(without clicking on it)?
Q2: how can I prevent that the picture is stretched out (misformed) when
it is too small, but is always shrinked when it is too big (so you see the
whole picture without deformation). When I use a picture-object, I cannot
shrink, so I used a button (with picture), but the I get a deformation.
Can you help me?
Thanks
Jos Vens
|