Hide

SftButton/OCX 3.0 - Button Control

Display
Print

BorderAlways Property, SftButton Object

Defines whether the control border is always displayed.

Syntax

Get

VB.NETBoolean = object.BorderAlways As Boolean
VBBoolean = object.BorderAlways As Boolean
C#.NETbool Boolean = object.BorderAlways;
VC++VARIANT_BOOL Boolean = object->BorderAlways;
VARIANT_BOOL Boolean = object->GetBorderAlways();
CHRESULT object->get_BorderAlways(VARIANT_BOOL* Boolean);

Put

VB.NETobject.BorderAlways = Boolean As Boolean
VBobject.BorderAlways = Boolean As Boolean
C#.NETbool object.BorderAlways = Boolean;
VC++VARIANT_BOOL object->BorderAlways = Boolean;
void object->PutBorderAlways(VARIANT_BOOL Boolean);
CHRESULT object->put_BorderAlways(VARIANT_BOOL Boolean);

object

A SftButton object.

Boolean

Defines whether the control border is always displayed.

BooleanDescription
TrueThe control's border is always displayed.
FalseThe control's border is only displayed if the control has the input focus, the control is the form's default button or the mouse cursor is located above the control's client area.

Comments

The BorderAlways property defines whether the control border is always displayed.

If the BorderAlways property is set to True, the button control behaves like a standard Windows button control and the border is always displayed.

If the BorderAlways property is set to False, the button's border is not visible, unless the control has the input focus, the control is the form's default button or the mouse cursor is located above the control's client area. This is usually used for controls on tool bars or other modeless windows.

If the ButtonStyle property is set to styleSftButtonNone, this property has no effect and is ignored. The border is never displayed.

The control's border style is defined using the BorderStyle property.

If Windows themes are used, the BorderAlways property has a theme dependent effect. Usually it controls the appearance of the border and results in the entire button being transparent until the mouse cursor moves into the control.

Examples

VB.NET

Private savedLoc As Point

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    ' save the button size to demonstrate auto-sizing
    savedSize = AxSftButton2.Size
    savedLoc = AxSftButton2.Location

    ' 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

VB6

Private Sub Form_Load()
    ' save the button size to demonstrate auto-sizing
    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

C#

private void Form1_Load(object sender, System.EventArgs e)
{
    // save the button size to demonstrate auto-sizing
    savedSize = axSftButton2.Size;
    savedLoc = axSftButton2.Location;

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

C++

    m_vCloseButton = m_CtlCloseButton.GetControlUnknown();

    // save the button size to demonstrate auto-sizing

    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";

See Also SftButton Object | Object Hierarchy


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