Hide

SftButton/OCX 3.0 - Button Control

Display
Print

Button Label

A button displays a button label, which consists of an optional text component and two optional picture components.

Text Component

The Text property defines the control's caption. One single line of text or multiple lines are possible. The text portion can also define an accelerator key using an embedded & character. If the text component is clipped horizontally, the text is truncated and the characters "..." are displayed at the end of the truncated text. If the text component is clipped vertically, no special processing occurs.

Picture Components

The properties Image1 and Image2 define optional picture components. Each can define a bitmap, icon, GDI+ image, Windows metafile. Icons, animations and Windows metafiles define transparent images and will be displayed properly within the button. The Image1Hover and Image2Hover properties are used if the mouse cursor is located on the control or picture component, Image1Pressed and Image2Pressed are used if the button is pressed or Image1Disabled and Image2Disabled are used if the control is disabled (see Enabled property). Otherwise, the Image1 and Image2 properties are used to determine the displayed graphics.

Properties

The button label of a button is defined using the following methods and properties:

Property/MethodDescription
AVIPlayDefines the animation used as a button picture component.
AVIPlayResourceDefines the animation used as a button picture component.
Image1Defines the first graphic.
Image1AlignHorzDefines the horizontal alignment of the first graphic.
Image1AlignVertDefines the vertical alignment of the first graphic.
Image1DisabledDefines the first graphic when the button is disabled.
Image1HoverDefines the first graphic when the mouse cursor is located on the control.
Image1PressedDefines the first graphic when the button is pressed.
Image2Defines the second graphic.
Image2AlignHorzDefines the horizontal alignment of the second graphic.
Image2AlignVertDefines the vertical alignment of the second graphic.
Image2DisabledDefines the second graphic when the button is disabled.
Image2HoverDefines the second graphic when the mouse cursor is located on the control.
TextDefines the control's caption.
TextAlignHorzDefines the horizontal alignment of the text.
TextAlignVertDefines the vertical alignment of the text.

Orientation

Two basic button label styles are available, defining the basic orientation of the text and picture components (Orientation property):

Horizontal Orientation
Vertical Orientation

Once the orientation is chosen, the relative position of each component (Image1, Text, Image2) is defined using the alignment properties Image1AlignHorz/Image1AlignVert, TextAlignHorz/TextAlignVert and Image2AlignHorz/Image2AlignVert.

Horizontal Orientation

The horizontally available empty space between the components Image1, Text, Image2 is distributed based on each component's alignment property setting. First, Image1 is aligned horizontally using the Image1AlignHorz property, then Text is aligned within the new remaining space using the TextAlignHorz property, followed by Image2 which is aligned within the remaining space using the Image2AlignHorz property. The vertical alignment is defined using the properties Image1AlignVert, TextAlignVert and Image2AlignVert.

If a component is empty or not defined, its alignment settings have no effect.

Vertical Orientation

The vertically available empty space between the components Image1, Text, Image2 is distributed based on each component's alignment property setting. First, Image1 is aligned vertically using the Image1AlignVert property, then Text is aligned within the new remaining space using the TextAlignVert property, followed by Image2 which is aligned within the remaining space using the Image2AlignVert property. The horizontal alignment is defined using the properties Image1AlignHorz, TextAlignHorz and Image2AlignHorz.

If a component is empty or not defined, its alignment settings have no effect.


Last Updated 08/13/2020 - (email)
© 2024 Softel vdm, Inc.