Hide

SftButton/OCX 3.0 - Button Control

Display
Print

Enabled Property, SftButton Object

Defines whether the control responds to user-generated events.

Syntax

Get

VB.NETBoolean = object.Enabled As Boolean
VBBoolean = object.Enabled As Boolean
C#.NETbool Boolean = object.Enabled;
VC++VARIANT_BOOL Boolean = object->Enabled;
VARIANT_BOOL Boolean = object->GetEnabled();
CHRESULT object->get_Enabled(VARIANT_BOOL* Boolean);

Put

VB.NETobject.Enabled = Boolean As Boolean
VBobject.Enabled = Boolean As Boolean
C#.NETbool object.Enabled = Boolean;
VC++VARIANT_BOOL object->Enabled = Boolean;
void object->PutEnabled(VARIANT_BOOL Boolean);
CHRESULT object->put_Enabled(VARIANT_BOOL Boolean);

object

A SftButton object.

Boolean

Defines whether the control responds to user-generated events.

BooleanDescription
TrueThe control responds to user-generated events.
FalseThe control is disabled and does not respond to user-generated events. It is painted in a "grayed" style.

Comments

The Enabled property defines whether the control responds to user-generated events.

If the control is disabled, it uses the colors specified for the disabled state (usually containing the text "Grayed") and picture components defined using bitmaps are displayed in a grayed fashion.

Examples

VB.NET

    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

Private Sub check1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles check1.CheckedChanged
    ' enable/disable the control so the image changes
    AxSftButton1.Enabled = Not check1.Checked
End Sub

Private Sub check2_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles check2.CheckedChanged
    ' resize the control
    If check2.Checked Then
#If VisualStudio2003AndEarlier Then
        AxSftButton2.AutoSize = SftButtonAutoSizeConstants.autosizeSftButtonLeftCenter

VB6

    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

Private Sub Check2_Click()
    ' resize the control
    If Check2.Value Then
        SftButton2.AutoSize = autosizeSftButtonLeftCenter
    Else

C#

    axSftButtonCheck.Image1.Appearance = SftPictureImageConstants.sftImageCheckboxYes;
    axSftButtonCheck.Text = "A SftButton control that looks like a check box with a caption";
    axSftButtonCheck.ShowFocus = false;
}

private void check1_CheckedChanged(object sender, System.EventArgs e)
{
    // enable/disable the control so the image changes
    axSftButton1.Enabled = !check1.Checked;
}

private void check2_CheckedChanged(object sender, System.EventArgs e)
{
    // resize the control
    if (check2.Checked) {
#if VisualStudio2003AndEarlier

See Also SftButton Object | Object Hierarchy


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