Hide

SftButton/OCX 3.0 - Button Control

Display
Print

ButtonStyle Property, SftButton Object

Defines the button style.

Syntax

Get

VB.NETStyle = object.ButtonStyle As SftButtonStyleConstants
VBStyle = object.ButtonStyle As SftButtonStyleConstants
C#.NETSftButtonStyleConstants Style = object.ButtonStyle;
VC++enum SftButtonStyleConstants Style = object->ButtonStyle;
enum SftButtonStyleConstants Style = object->GetButtonStyle();
CHRESULT object->get_ButtonStyle(enum SftButtonStyleConstants* Style);

Put

VB.NETobject.ButtonStyle = Style As SftButtonStyleConstants
VBobject.ButtonStyle = Style As SftButtonStyleConstants
C#.NETSftButtonStyleConstants object.ButtonStyle = Style;
VC++enum SftButtonStyleConstants object->ButtonStyle = Style;
void object->PutButtonStyle(enum SftButtonStyleConstants Style);
CHRESULT object->put_ButtonStyle(enum SftButtonStyleConstants Style);

object

A SftButton object.

Style

Defines the button style.

NameValueDescription
styleSftButtonButton0Button
styleSftButtonDropDown1Button with drop down button
styleSftButtonNone2No Button Background - Only the graphics and text components are displayed. The control area is transparent (except at design time) and only the graphics and text components are rendered transparently on the containing window's background.

Comments

The ButtonStyle property defines the button style.

Examples

VB.NET

    ' initialize a SftButton control to look like a check box
    AxSftButtonCheck.BorderAlways = False
#If VisualStudio2003AndEarlier Then
    AxSftButtonCheck.AutoSize = SftButtonAutoSizeConstants.autosizeSftButtonLeftCenter
#Else
    AxSftButtonCheck.CtlAutoSize = SftButtonAutoSizeConstants.autosizeSftButtonLeftCenter
#End If
    AxSftButtonCheck.Bounce = SftButtonBounceStyleConstants.bounceSftButtonNo
    AxSftButtonCheck.ButtonStyle = SftButtonStyleConstants.styleSftButtonNone
    AxSftButtonCheck.ClickStyle = SftButtonClickStyleConstants.clickstyleSftButtonPictures
    AxSftButtonCheck.HoverStyle = SftButtonHoverStyleConstants.hoverstyleSftButtonExact
    AxSftButtonCheck.Image1.Appearance = SftPictureImageConstants.sftImageCheckboxYes
    AxSftButtonCheck.Text = "A SftButton control that looks like a check box with a caption"
    AxSftButtonCheck.ShowFocus = False
End Sub

VB6

    savedWidth = SftButton2.Width
    savedHeight = SftButton2.Height
    savedYPos = SftButton2.Top

    ' initialize a SftButton control to look like a check box
    SftButtonCheck.BorderAlways = False
    SftButtonCheck.AutoSize = autosizeSftButtonLeftCenter
    SftButtonCheck.Bounce = bounceSftButtonNo
    SftButtonCheck.ButtonStyle = styleSftButtonNone
    SftButtonCheck.ClickStyle = clickstyleSftButtonPictures
    SftButtonCheck.HoverStyle = hoverstyleSftButtonExact
    SftButtonCheck.Image1.Appearance = sftImageCheckboxYes
    SftButtonCheck.Text = "A SftButton control that looks like a check box with a caption"
    SftButtonCheck.ShowFocus = False
End Sub

C#

    // initialize a SftButton control to look like a check box
    axSftButtonCheck.BorderAlways = false;
#if VisualStudio2003AndEarlier
    axSftButtonCheck.AutoSize = SftButtonAutoSizeConstants.autosizeSftButtonLeftCenter;
#else
    axSftButtonCheck.CtlAutoSize = SftButtonAutoSizeConstants.autosizeSftButtonLeftCenter;
#endif
    axSftButtonCheck.Bounce = SftButtonBounceStyleConstants.bounceSftButtonNo;
    axSftButtonCheck.ButtonStyle = SftButtonStyleConstants.styleSftButtonNone;
    axSftButtonCheck.ClickStyle = SftButtonClickStyleConstants.clickstyleSftButtonPictures;
    axSftButtonCheck.HoverStyle = SftButtonHoverStyleConstants.hoverstyleSftButtonExact;
    axSftButtonCheck.Image1.Appearance = SftPictureImageConstants.sftImageCheckboxYes;
    axSftButtonCheck.Text = "A SftButton control that looks like a check box with a caption";
    axSftButtonCheck.ShowFocus = false;
}

C++

    m_CtlButton2.GetClientRect(&m_savedRect);
    m_CtlButton2.MapWindowPoints(this, &m_savedRect);

    // initialize a SftButton control to look like a check box
    m_vButtonCheck->BorderAlways = VARIANT_FALSE;
    m_vButtonCheck->AutoSize = autosizeSftButtonLeftCenter;
    m_vButtonCheck->Bounce = bounceSftButtonNo;
    m_vButtonCheck->ButtonStyle = styleSftButtonNone;
    m_vButtonCheck->ClickStyle = clickstyleSftButtonPictures;
    m_vButtonCheck->HoverStyle = hoverstyleSftButtonExact;
    m_vButtonCheck->Image1->Appearance = sftImageCheckboxYes;
    m_vButtonCheck->Text = "A SftButton control that looks like a check box with a caption";
    m_vButtonCheck->ShowFocus = VARIANT_FALSE;

    return TRUE;  // return TRUE  unless you set the focus to a control
}

See Also SftButton Object | Object Hierarchy


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