Hide

SftButton/OCX 3.0 - Button Control

Display
Print

TextAlignHorz Property, SftButton Object

Defines the horizontal alignment of the text.

Syntax

Get

VB.NETAlign = object.TextAlignHorz As SftButtonAlignConstants
VBAlign = object.TextAlignHorz As SftButtonAlignConstants
C#.NETSftButtonAlignConstants Align = object.TextAlignHorz;
VC++enum SftButtonAlignConstants Align = object->TextAlignHorz;
enum SftButtonAlignConstants Align = object->GetTextAlignHorz();
CHRESULT object->get_TextAlignHorz(enum SftButtonAlignConstants* Align);

Put

VB.NETobject.TextAlignHorz = Align As SftButtonAlignConstants
VBobject.TextAlignHorz = Align As SftButtonAlignConstants
C#.NETSftButtonAlignConstants object.TextAlignHorz = Align;
VC++enum SftButtonAlignConstants object->TextAlignHorz = Align;
void object->PutTextAlignHorz(enum SftButtonAlignConstants Align);
CHRESULT object->put_TextAlignHorz(enum SftButtonAlignConstants Align);

object

A SftButton object.

Align

Defines the horizontal alignment of the text.

NameValueDescription
alignSftButtonCenter0The text is horizontally centered within the available space.
alignSftButtonLeft1The text is left aligned within the available space.
alignSftButtonRight2The text is right aligned within the available space.

Comments

The TextAlignHorz property defines the horizontal alignment of the text.

The layout of the button label and the position and alignment of the text are defined using the Orientation, TextAlignHorz and TextAlignVert properties.

For detailed information on the use of the Orientation, Image1, Image1AlignHorz, Image1AlignVert, Image2, Image2AlignHorz, Image2AlignVert, Text, TextAlignHorz, TextAlignVert properties, please see "Button Label".

Examples

VB.NET

    AxSftButton1.ButtonStyle = SftButtonStyleConstants.styleSftButtonDropDown
    AxSftButton1.DropDownPressed = False
    AxSftButton1.DropDownStyle = SftButtonDropDownStyleConstants.dropdownstyleSftButtonStandard
    AxSftButton1.FillOrientation = SftButtonOrientationConstants.orientationSftButtonHorizontal
    AxSftButton1.Orientation = SftButtonOrientationConstants.orientationSftButtonHorizontal
    AxSftButton1.Pressed = False
    AxSftButton1.ShowFocus = True
    AxSftButton1.Text = "Code Sample"
    AxSftButton1.TextAlignHorz = SftButtonAlignConstants.alignSftButtonCenter
    AxSftButton1.TextAlignVert = SftButtonAlignVertConstants.alignSftButtonVCenter
    AxSftButton1.UseThemes = SftButtonThemesConstants.themesSftButtonNo
    ' Behavior
    AxSftButton1.AllowFocus = True
    AxSftButton1.Bounce = SftButtonBounceStyleConstants.bounceSftButtonYes
    AxSftButton1.ClickInterval = 100
    AxSftButton1.DropDownDownClick = True

VB6

    SftButton1.ButtonStyle = styleSftButtonDropDown
    SftButton1.DropDownPressed = False
    SftButton1.DropDownStyle = dropdownstyleSftButtonStandard
    SftButton1.FillOrientation = orientationSftButtonHorizontal
    SftButton1.Orientation = orientationSftButtonHorizontal
    SftButton1.Pressed = False
    SftButton1.ShowFocus = True
    SftButton1.Text = "Code Sample"
    SftButton1.TextAlignHorz = alignSftButtonCenter
    SftButton1.TextAlignVert = alignSftButtonVCenter
    SftButton1.UseThemes = themesSftButtonNo
' Behavior
    SftButton1.AllowFocus = True
    SftButton1.Bounce = bounceSftButtonYes
    SftButton1.ClickInterval = 100
    SftButton1.DropDownDownClick = True

C#

    axSftButton1.ButtonStyle = SftButtonStyleConstants.styleSftButtonDropDown;
    axSftButton1.DropDownPressed = false;
    axSftButton1.DropDownStyle = SftButtonDropDownStyleConstants.dropdownstyleSftButtonStandard;
    axSftButton1.FillOrientation = SftButtonOrientationConstants.orientationSftButtonHorizontal;
    axSftButton1.Orientation = SftButtonOrientationConstants.orientationSftButtonHorizontal;
    axSftButton1.Pressed = false;
    axSftButton1.ShowFocus = true;
    axSftButton1.Text = "Code Sample";
    axSftButton1.TextAlignHorz = SftButtonAlignConstants.alignSftButtonCenter;
    axSftButton1.TextAlignVert = SftButtonAlignVertConstants.alignSftButtonVCenter;
    axSftButton1.UseThemes = SftButtonThemesConstants.themesSftButtonNo;
    // Behavior
    axSftButton1.AllowFocus = true;
    axSftButton1.Bounce = SftButtonBounceStyleConstants.bounceSftButtonYes;
    axSftButton1.ClickInterval = 100;
    axSftButton1.DropDownDownClick = true;

C++

    m_vButton->put_ButtonStyle(styleSftButtonDropDown);
    m_vButton->put_DropDownPressed(VARIANT_FALSE);
    m_vButton->put_DropDownStyle(dropdownstyleSftButtonStandard);
    m_vButton->put_FillOrientation(orientationSftButtonHorizontal);
    m_vButton->put_Orientation(orientationSftButtonHorizontal);
    m_vButton->put_Pressed(VARIANT_FALSE);
    m_vButton->put_ShowFocus(VARIANT_TRUE);
    m_vButton->put_Text(_bstr_t(_T("Code Sample")));
    m_vButton->put_TextAlignHorz(alignSftButtonCenter);
    m_vButton->put_TextAlignVert(alignSftButtonVCenter);
    m_vButton->put_UseThemes(themesSftButtonNo);
// Behavior
    m_vButton->put_AllowFocus(VARIANT_TRUE);
    m_vButton->put_Bounce(bounceSftButtonYes);
    m_vButton->put_ClickInterval(100);
    m_vButton->put_DropDownDownClick(VARIANT_TRUE);

See Also SftButton Object | Object Hierarchy


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