PictureAlignment property

Specifies the location of a background picture.

Syntax

object.PictureAlignment [= fmPictureAlignment ]

The PictureAlignment property syntax has these parts:

Part Description
object Required. A valid object.
fmPictureAlignment Optional. The position where the picture aligns with the control.

Settings

The settings for fmPictureAlignment are:

Constant Value Description
fmPictureAlignmentTopLeft 0 The top left corner.
fmPictureAlignmentTopRight 1 The top right corner.
fmPictureAlignmentCenter 2 The center.
fmPictureAlignmentBottomLeft 3 The bottom left corner.
fmPictureAlignmentBottomRight 4 The bottom right corner.

Remarks

The PictureAlignment property identifies which corner of the picture is the same as the corresponding corner of the control or container where the picture is used.

For example, setting PictureAlignment to fmPictureAlignmentTopLeft means that the top left corner of the picture coincides with the top left corner of the control or container. Setting PictureAlignment to fmPictureAlignmentCenter positions the picture in the middle, relative to the height as well as the width of the control or container.

If you tile an image on a control or container, the setting of PictureAlignment affects the tiling pattern. For example, if PictureAlignment is set to fmPictureAlignmentUpperLeft, the first copy of the image is laid in the upper left corner of the control or container and additional copies are tiled from left to right across each row. If PictureAlignment is fmPictureAlignmentCenter, the first copy of the image is laid at the center of the control or container, additional copies are laid to the left and right to complete the row, and additional rows are added to fill the control or container.

Note

Setting the PictureSizeMode property to fmSizeModeStretch overrides PictureAlignment. When PictureSizeMode is set to fmSizeModeStretch, the picture fills the entire control or container.

See also

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.