Hide

SftButton/OCX 3.0 - Button Control

Display
Print

BackColor Property, SftButton Object

Defines the control's background color.

Syntax

Get

VB.NETClr = object.BackColor As System.Drawing.Color
Clr = object.CtlBackColor As System.Drawing.Color
VBClr = object.BackColor As OLE_COLOR
C#.NETSystem.Drawing.Color Clr = object.BackColor;
System.Drawing.Color Clr = object.CtlBackColor;
VC++OLE_COLOR Clr = object->BackColor;
OLE_COLOR Clr = object->GetBackColor();
CHRESULT object->get_BackColor(OLE_COLOR* Clr);

Put

VB.NETobject.BackColor = Clr As System.Drawing.Color
object.CtlBackColor = Clr As System.Drawing.Color
VBobject.BackColor = Clr As OLE_COLOR
C#.NETSystem.Drawing.Color object.BackColor = Clr;
System.Drawing.Color object.CtlBackColor = Clr;
VC++OLE_COLOR object->BackColor = Clr;
void object->PutBackColor(OLE_COLOR Clr);
CHRESULT object->put_BackColor(OLE_COLOR Clr);

object

A SftButton object.

Clr

Defines the control's background color. For information about color properties, please visit the applicable section "Using SftButton/OCX with ...".

Comments

The BackColor property defines the control's background color.

This property has no effect if Windows themes are used.

The defined color is used for the entire control. If the button control has the input focus, the BackColorFocus color is used instead. If the button or drop down button is pressed, the BackColorPressed color is used instead for the pressed portion. If the mouse hovers over the control, the color defined using BackColorHover is used.

If both BackColorStart and BackColorEnd define valid starting and ending colors, these take precedence and the BackColor property has no effect.

Examples

VB.NET

    AxSftButton1.DropDownToggle = False
    AxSftButton1.Enabled = True
    AxSftButton1.Follows = False
    AxSftButton1.OLEDragMode = SftButtonOLEDragModeConstants.OLEDragSftButtonNone
    AxSftButton1.OLEDropMode = SftButtonOLEDropModeConstants.OLEDropSftButtonNone
    AxSftButton1.RightToLeft = False
    AxSftButton1.Toggle = False
    ' Colors
    AxSftButton1.BackColor = SystemColors.Control
    AxSftButton1.BackColorStart = Color.Green
    AxSftButton1.BackColorEnd = Color.Blue
    AxSftButton1.BackColorFocus = SystemColors.Control
    AxSftButton1.BackColorFocusStart = Color.Red
    AxSftButton1.BackColorFocusEnd = Color.Green
    AxSftButton1.BackColorHover = SystemColors.Control
    AxSftButton1.BackColorHoverStart = Color.Yellow

VB6

    SftButton1.DropDownToggle = False
    SftButton1.Enabled = True
    SftButton1.Follows = False
    SftButton1.OLEDragMode = OLEDragSftButtonNone
    SftButton1.OLEDropMode = OLEDropSftButtonNone
    SftButton1.RightToLeft = False
    SftButton1.Toggle = False
' Colors
    SftButton1.BackColor = vbButtonFace
    SftButton1.BackColorStart = vbGreen
    SftButton1.BackColorEnd = vbBlue
    SftButton1.BackColorFocus = vbButtonFace
    SftButton1.BackColorFocusStart = vbRed
    SftButton1.BackColorFocusEnd = vbGreen
    SftButton1.BackColorHover = vbButtonFace
    SftButton1.BackColorHoverStart = vbYellow

C#

    axSftButton1.DropDownToggle = false;
    axSftButton1.Enabled = true;
    axSftButton1.Follows = false;
    axSftButton1.OLEDragMode = SftButtonOLEDragModeConstants.OLEDragSftButtonNone;
    axSftButton1.OLEDropMode = SftButtonOLEDropModeConstants.OLEDropSftButtonNone;
    axSftButton1.RightToLeft = false;
    axSftButton1.Toggle = false;
    // Colors
    axSftButton1.BackColor = SystemColors.Control;
    axSftButton1.BackColorStart = Color.Green;
    axSftButton1.BackColorEnd = Color.Blue;
    axSftButton1.BackColorFocus = SystemColors.Control;
    axSftButton1.BackColorFocusStart = Color.Red;
    axSftButton1.BackColorFocusEnd = Color.Green;
    axSftButton1.BackColorHover = SystemColors.Control;
    axSftButton1.BackColorHoverStart = Color.Yellow;

C++

    m_vButton->put_DropDownToggle(VARIANT_FALSE);
    m_vButton->put_Enabled(VARIANT_TRUE);
    m_vButton->put_Follows(VARIANT_FALSE);
    m_vButton->put_OLEDragMode(OLEDragSftButtonNone);
    m_vButton->put_OLEDropMode(OLEDropSftButtonNone);
    m_vButton->put_RightToLeft(VARIANT_FALSE);
    m_vButton->put_Toggle(VARIANT_FALSE);
// Colors
    m_vButton->put_BackColor(COLOR_BTNFACE|0x80000000L);
    m_vButton->put_BackColorStart(RGB(0,255,0));
    m_vButton->put_BackColorEnd(RGB(0,0,255));
    m_vButton->put_BackColorFocus(COLOR_BTNFACE|0x80000000L);
    m_vButton->put_BackColorFocusStart(RGB(255,0,0));
    m_vButton->put_BackColorFocusEnd(RGB(0,255,0));
    m_vButton->put_BackColorHover(COLOR_BTNFACE|0x80000000L);
    m_vButton->put_BackColorHoverStart(RGB(0,255,255));

See Also SftButton Object | Object Hierarchy


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