Hide

SftButton/OCX 3.0 - Button Control

Display
Print

Appearance Property, SftPictureObject Object

Defines the image object using a built-in, special purpose image.

Syntax

Get

VB.NETStyle = object.Appearance As SftPictureImageConstants
VBStyle = object.Appearance As SftPictureImageConstants
C#.NETSftPictureImageConstants Style = object.Appearance;
VC++enum SftPictureImageConstants Style = object->Appearance;
enum SftPictureImageConstants Style = object->GetAppearance();
CHRESULT object->get_Appearance(enum SftPictureImageConstants* Style);

Put

VB.NETobject.Appearance = Style As SftPictureImageConstants
VBobject.Appearance = Style As SftPictureImageConstants
C#.NETSftPictureImageConstants object.Appearance = Style;
VC++enum SftPictureImageConstants object->Appearance = Style;
void object->PutAppearance(enum SftPictureImageConstants Style);
CHRESULT object->put_Appearance(enum SftPictureImageConstants Style);

object

A SftPictureObject object.

Style

Defines the image object using a built-in, special purpose image.

NameValueDescription
sftImageNone-1None
sftImageCheckboxNo0Checkbox - No
sftImageCheckboxYes1Checkbox - Yes
sftImageCheckboxUnknown2Checkbox - Unknown
sftImageCheckboxNoDisabled3Checkbox - No, Disabled
sftImageCheckboxYesDisabled4Checkbox - Yes, Disabled
sftImageCheckboxUnknownDisabled5Checkbox - Unknown, Disabled
sftImageRadioButtonNo6RadioButton - No
sftImageRadioButtonYes7RadioButton - Yes
sftImageRadioButtonNoDisabled8RadioButton - No, Disabled
sftImageRadioButtonYesDisabled9RadioButton - Yes, Disabled
sftImageUp10Up
sftImageUpDisabled11Up, Disabled
sftImageDown12Down
sftImageDownDisabled13Down, Disabled
sftImageSortAsc14Sort Ascending
sftImageSortAscDisabled15Sort Ascending, Disabled
sftImageSortDesc16Sort Descending
sftImageSortDescDisabled17Sort Descending, Disabled

Comments

The Appearance property defines the image object using a built-in, special purpose image.

The SftPictureObject.Type property is set to sftTypeBuiltin.

The SftPictureObject.Height and SftPictureObject.Width properties should be used to define the requested image size. The SftPictureObject.ActualHeight and SftPictureObject.ActualWidth properties reflect the image dimensions.

Examples

VB.NET

End Sub

Private Sub CloseButton_ClickEvent(ByVal sender As Object, ByVal e As System.EventArgs) Handles CloseButton.ClickEvent
    Application.Exit()
End Sub

Private Sub AxSftButtonCheck_ClickEvent(ByVal sender As Object, ByVal e As System.EventArgs) Handles AxSftButtonCheck.ClickEvent
    ' toggle the check box
    If AxSftButtonCheck.Image1.Appearance = SftPictureImageConstants.sftImageCheckboxYes Then
        AxSftButtonCheck.Image1.Appearance = SftPictureImageConstants.sftImageCheckboxNo
    Else
        AxSftButtonCheck.Image1.Appearance = SftPictureImageConstants.sftImageCheckboxYes
    End If
End Sub

Private Sub AxSftButtonCheck_DblClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles AxSftButtonCheck.DblClick

VB6

    ' 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

Private Sub Check1_Click()
    ' enable/disable the control so the image changes
    SftButton1.Enabled = (Check1.Value = 0)
End Sub

C#

private void CloseButton_ClickEvent(object sender, System.EventArgs e)
{
    Application.Exit();
}

private void axSftButtonCheck_ClickEvent(object sender, System.EventArgs e)
{
    // toggle the check box
    if (axSftButtonCheck.Image1.Appearance == SftPictureImageConstants.sftImageCheckboxYes)
        axSftButtonCheck.Image1.Appearance = SftPictureImageConstants.sftImageCheckboxNo;
    else
        axSftButtonCheck.Image1.Appearance = SftPictureImageConstants.sftImageCheckboxYes;
}

private void axSftButtonCheck_DblClick(object sender, System.EventArgs e)
{

C++

    // 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
}

// If you add a minimize button to your dialog, you will need the code below
//  to draw the icon.  For MFC applications using the document/view model,

See Also SftPictureObject Object | Object Hierarchy


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