Skip to main content

CaptionList Property

The list of captions to appear on the button's surface.

Definition​

Property "OLE.CaptionList" as List

Values​

This property is an @FM delimited list of caption definitions, with each item having the following multivalue structure:

PosNameTypeDescription
<1, 1>CaptionStringThe caption text
<1, 2>Horizontal AlignmentString (See Remarks)Horizontal alignment of the caption
<1, 3>Vertical AlignmentString (See Remarks)Vertical alignment of the caption
<1, 4>FontFontFont used to render the caption
<1, 5>ColorColorColor used to render the caption

Remarks​

The CaptionList property adds unique functionality to the SRP Button Control. The Caption property is useful for adding a single centered caption, which meets most basic needs. The CaptionList property allows you to place any number of captions aligned and formatted as you see fit.

Precision Alignment​

The Horizontal Alignment and Vertical Alignment values are especially formatted for flexibility. For simple alignment, set the horizontal alignment to L, C, or R for Left, Center, or Right alignment respectively. Likewise, set the vertical alignment to T, C, or B for Top, Center, or Bottom respectively.

For additional precision, you can append a numerical offset to the alignment value. For example, setting the horizontal alignment to L10 means you want the caption left aligned and offset 10 pixels to the right. To offset from the right or bottom, use negative numbers. For example, B-10 indicates you want the caption bottom aligned and offset 10 pixels up.

Ideas on Customizing Captions and Icons​

For more information and ideas regarding caption and icon lists, see the CaptionList and IconList topic.

Example​

// Set a button whose caption is "Hello World" with each word in opposite corners
CaptionList = ""
CaptionList<1> = "Hello":@VM:"L":@VM:"T"
CaptionList<2> = "World":@VM:"R":@VM:"B"
Set_Property(@Window:".OLE_BUTTON", "OLE.CaptionList", CaptionList)

See Also​

Caption, IconList