Partager via


PicturePosition Property

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

The picture and caption, as a unit, appear centered on the control. If no caption exists, the picture is located relative to the center of the control. The PicturePosition property is affected by the Picture, DownPicture, and DisabledPicture properties. For more information, see Picture Property, DownPicture Property, and DisabledPicture Property.

Note

To apply PicturePosition, you must specify an image for the Picture property. The size of the image is fixed. If you want to stretch, resize, or crop the image, you must use an Image control. Animated .gif files are not supported. For more information, see Image Control.

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

    (Default) 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.

    14

    No text. The picture appears centered and hides the text specified by the Caption property. For more information, see Caption Property.

    Tip

    To apply this setting, the Style property of the control must be set to 1 (Graphical). Use this setting when you want to provide a hotkey without displaying text on the control. For more information, see Style Property.

Remarks

Applies To: CommandButton Control | OptionButton Control | CheckBox Control

For CommandButton controls, Visual FoxPro disregards PicturePosition if Style is set to 1 (Invisible).

The WordWrap property and the AutoSize property are supported with PicturePosition. For more information, see WordWrap Property and AutoSize Property.

The SpecialEffect and VisualEffect properties affect the outer border but do not affect PicturePosition. For more information, see SpecialEffect Property and VisualEffect Property.

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 the button. Setting PicturePosition to a value of 13 corresponds with behavior in versions prior to Visual FoxPro 8.0.

See Also

Reference

PictureSpacing Property
PictureMargin Property

Other Resources

Properties (Visual FoxPro)