Microsoft Office Tutorials and References
In Depth Information
Adding graphics to UserForms
Adding graphics to UserForms
One way to add some visual interest or useful information to a VBA UserForm is by adding
graphics. To add an image to a UserForm, display the UserForm in the Visual Basic Editor
and then, in the Toolbox, click the Image button. Drag on the UserForm to define the frame
within which the image should appear.
To select the graphic you want to display on the UserForm, click the image control on the
UserForm and then, in the Properties panel, click in the box next to the Picture property
name. Click the Browse button that appears, navigate to the folder that contains the image
you want to add to the UserForm, click the image, and then click Open to display it.
Unless the image you selected fits exactly in the frame, just a portion of it is displayed on
the UserForm. You can control the way the image fits within the frame by assigning the
value you want to the PictureSizeMode property. That property has three possible values:
0 – fmPictureSizeModeClip Displays as much of the image as possible within the
frame
1 – fmPictureSizeModeStretch Displays the entire image within the frame but
stretches the image so that it ills the entire frame
3 – fmPictureSizeModeZoom Displays the entire image within the frame but keeps
the vertical and horizontal dimensions in their original ratio
12
 
Search JabSto ::




Custom Search