Hide

SftButton/OCX 3.0 - Button Control

Display
Print

AllowFocus Property, SftButton Object

Defines whether the control can receive the input focus.

Syntax

Get

VB.NETBoolean = object.AllowFocus As Boolean
VBBoolean = object.AllowFocus As Boolean
C#.NETbool Boolean = object.AllowFocus;
VC++VARIANT_BOOL Boolean = object->AllowFocus;
VARIANT_BOOL Boolean = object->GetAllowFocus();
CHRESULT object->get_AllowFocus(VARIANT_BOOL* Boolean);

Put

VB.NETobject.AllowFocus = Boolean As Boolean
VBobject.AllowFocus = Boolean As Boolean
C#.NETbool object.AllowFocus = Boolean;
VC++VARIANT_BOOL object->AllowFocus = Boolean;
void object->PutAllowFocus(VARIANT_BOOL Boolean);
CHRESULT object->put_AllowFocus(VARIANT_BOOL Boolean);

object

A SftButton object.

Boolean

Defines whether the control can receive the input focus.

BooleanDescription
TrueThe control will receive the input focus when the user clicks on it.
FalseThe control will not receive the input focus when the user clicks on it.

Comments

The AllowFocus property defines whether the control can receive the input focus.

Setting AllowFocus to False has no effect when used with .NET. The ShowFocus property can be used to suppress the display of the focus rectangle instead.

By setting this property to False, the control will not receive the input focus, even when the user clicks on the control. This is usually used for controls on tool bars or other modeless windows. To make sure that the control cannot be reached using the keyboard, the control cannot be a valid tab stop. For example, when using Visual Basic, the TabStop property should be set to False. Visual C++ users should make sure the WS_TABSTOP window style is not defined.

If the AllowFocus property is set to False, the control does not support accelerator keys.

Examples

VB.NET

    AxSftButton1.Orientation = SftButtonOrientationConstants.orientationSftButtonHorizontal
    AxSftButton1.Pressed = False
    AxSftButton1.ShowFocus = True
    AxSftButton1.Text = "Code Sample"
    AxSftButton1.TextAlignHorz = SftButtonAlignConstants.alignSftButtonCenter
    AxSftButton1.TextAlignVert = SftButtonAlignVertConstants.alignSftButtonVCenter
    AxSftButton1.UseThemes = SftButtonThemesConstants.themesSftButtonNo
    ' Behavior
    AxSftButton1.AllowFocus = True
    AxSftButton1.Bounce = SftButtonBounceStyleConstants.bounceSftButtonYes
    AxSftButton1.ClickInterval = 100
    AxSftButton1.DropDownDownClick = True
    AxSftButton1.DropDownFollows = False
    AxSftButton1.DropDownPressed = False
    AxSftButton1.DropDownToggle = False
    AxSftButton1.Enabled = True

VB6

    SftButton1.Orientation = orientationSftButtonHorizontal
    SftButton1.Pressed = False
    SftButton1.ShowFocus = True
    SftButton1.Text = "Code Sample"
    SftButton1.TextAlignHorz = alignSftButtonCenter
    SftButton1.TextAlignVert = alignSftButtonVCenter
    SftButton1.UseThemes = themesSftButtonNo
' Behavior
    SftButton1.AllowFocus = True
    SftButton1.Bounce = bounceSftButtonYes
    SftButton1.ClickInterval = 100
    SftButton1.DropDownDownClick = True
    SftButton1.DropDownFollows = False
    SftButton1.DropDownPressed = False
    SftButton1.DropDownToggle = False
    SftButton1.Enabled = True

C#

    axSftButton1.Orientation = SftButtonOrientationConstants.orientationSftButtonHorizontal;
    axSftButton1.Pressed = false;
    axSftButton1.ShowFocus = true;
    axSftButton1.Text = "Code Sample";
    axSftButton1.TextAlignHorz = SftButtonAlignConstants.alignSftButtonCenter;
    axSftButton1.TextAlignVert = SftButtonAlignVertConstants.alignSftButtonVCenter;
    axSftButton1.UseThemes = SftButtonThemesConstants.themesSftButtonNo;
    // Behavior
    axSftButton1.AllowFocus = true;
    axSftButton1.Bounce = SftButtonBounceStyleConstants.bounceSftButtonYes;
    axSftButton1.ClickInterval = 100;
    axSftButton1.DropDownDownClick = true;
    axSftButton1.DropDownFollows = false;
    axSftButton1.DropDownPressed = false;
    axSftButton1.DropDownToggle = false;
    axSftButton1.Enabled = true;

C++

    m_vButton->put_Orientation(orientationSftButtonHorizontal);
    m_vButton->put_Pressed(VARIANT_FALSE);
    m_vButton->put_ShowFocus(VARIANT_TRUE);
    m_vButton->put_Text(_bstr_t(_T("Code Sample")));
    m_vButton->put_TextAlignHorz(alignSftButtonCenter);
    m_vButton->put_TextAlignVert(alignSftButtonVCenter);
    m_vButton->put_UseThemes(themesSftButtonNo);
// Behavior
    m_vButton->put_AllowFocus(VARIANT_TRUE);
    m_vButton->put_Bounce(bounceSftButtonYes);
    m_vButton->put_ClickInterval(100);
    m_vButton->put_DropDownDownClick(VARIANT_TRUE);
    m_vButton->put_DropDownFollows(VARIANT_FALSE);
    m_vButton->put_DropDownPressed(VARIANT_FALSE);
    m_vButton->put_DropDownToggle(VARIANT_FALSE);
    m_vButton->put_Enabled(VARIANT_TRUE);

See Also SftButton Object | Object Hierarchy


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