PicturePosition Property

Specifies the location of a picture relative to its caption. Read/write at run time.

Object.PicturePosition [ = nValue ]

Parameters

  • nValue
    Specifies alignment for a picture. The following table lists the settings for nValue.
    nValue Setting
    0 The picture appears to the left of the caption. The picture aligns with the top of the caption.
    1 The picture appears to the left of the caption. The picture is centered relative to the caption.
    2 The picture appears to the left of the caption. The picture aligns with the bottom of the caption.
    3 The picture appears to the right of the caption. The picture aligns with top of the caption.
    4 The picture appears to the right of the caption. The picture is centered relative to the caption.
    5 The picture appears to the right of the caption. The picture aligns with the bottom of the caption.
    6 The picture appears above the caption. The picture aligns with the left edge of the caption.
    7 The picture appears above the caption. The picture is centered above the caption.
    8 The picture appears above the caption. The picture aligns with the right edge of the caption.
    9 The picture appears below the caption. The picture aligns with the left edge of the caption.
    10 The picture appears below the caption. The picture is centered below the caption.
    11 The picture appears below the caption. The picture aligns with the right edge of the caption.
    12 The picture appears in the center of the control. The caption is centered horizontally and vertically with top of the picture.
    13 The picture appears in the center of the control. The caption is centered below the picture but stays relative to the bottom of the button when resized. (Default)

Remarks

The picture and caption, as a unit, are centered on the control. If no caption exists, the picture is located relative to the center of the control.

The PicturePosition property is supported on OptionButton and CheckBox controls when their Style properties are set to a value of 1 (Graphical). When Style is set to a value other than 1, Visual FoxPro disregards PicturePosition in addition to Picture.

Visual FoxPro disregards PicturePosition if the Picture property does not specify a picture. For CommandButton controls, Visual FoxPro disregards PicturePosition if Style is set to 1 (Invisible).

Wordwrapping and the AutoSize property are supported with PicturePosition.

The SpecialEffect and VisualEffect properties affect the outer border but do not affect PicturePosition.

As with current behavior, the size of the image is fixed. If you want to stretch, resize, or crop the image, you must use an Image control.

Versions earlier than Visual FoxPro 8.0 use a positioning algorithm that differs slightly from the standard 0 – 12 settings. The image always remains centered; however, the text remains relative to the bottom of the image.

When PicturePosition is set to a value of 7, similar behavior occurs. However, as the button size is reduced, the text is cropped instead of shifted towards the top of of the button. Setting PicturePosition to a value of 13 corresponds with behavior in versions prior to Visual FoxPro 8.0.

Animated .gif files are not supported.

The PicturePosition property applies to the Picture, DownPicture, and DisabledPicture properties.

See Also

Properties | Picture Property | Style Property | AutoSize Property | SpecialEffect Property | VisualEffect Property | Image Control | DownPicture Property | DisabledPicture Property

Applies To: CommandButton Control | OptionButton Control | CheckBox Control