Hide

SftButton/OCX 3.0 - Button Control

Display
Print

AutoSize Property, SftButton Object

Defines how the control is resized based on its contents.

Syntax

Get

VB.NETStyle = object.AutoSize As SftButtonAutoSizeConstants
Style = object.CtlAutoSize As SftButtonAutoSizeConstants
VBStyle = object.AutoSize As SftButtonAutoSizeConstants
C#.NETSftButtonAutoSizeConstants Style = object.AutoSize;
SftButtonAutoSizeConstants Style = object.CtlAutoSize;
VC++enum SftButtonAutoSizeConstants Style = object->AutoSize;
enum SftButtonAutoSizeConstants Style = object->GetAutoSize();
CHRESULT object->get_AutoSize(enum SftButtonAutoSizeConstants* Style);

Put

VB.NETobject.AutoSize = Style As SftButtonAutoSizeConstants
object.CtlAutoSize = Style As SftButtonAutoSizeConstants
VBobject.AutoSize = Style As SftButtonAutoSizeConstants
C#.NETSftButtonAutoSizeConstants object.AutoSize = Style;
SftButtonAutoSizeConstants object.CtlAutoSize = Style;
VC++enum SftButtonAutoSizeConstants object->AutoSize = Style;
void object->PutAutoSize(enum SftButtonAutoSizeConstants Style);
CHRESULT object->put_AutoSize(enum SftButtonAutoSizeConstants Style);

object

A SftButton object.

Style

Defines how the control is resized based on its contents.

NameValueDescription
autosizeSftButtonNone0None - The control is not automatically resized.
autosizeSftButtonTopLeft1Top/Left Corner - The control is automatically resized. The top, left corner remains at the same position as the control is resized.
autosizeSftButtonTopRight2Top/Right Corner - The control is automatically resized. The top, right corner remains at the same position as the control is resized.
autosizeSftButtonBottomLeft3Bottom/Left Corner - The control is automatically resized. The bottom, left corner remains at the same position as the control is resized.
autosizeSftButtonBottomRight4Bottom/Right Corner - The control is automatically resized. The bottom, right corner remains at the same position as the control is resized.
autosizeSftButtonTopCenter5Top Center - The control is automatically resized. The top, center location remains at the same position as the control is resized.
autosizeSftButtonBottomCenter6Bottom Center - The control is automatically resized. The bottom, center location remains at the same position as the control is resized.
autosizeSftButtonLeftCenter7Left Side Center - The control is automatically resized. The left, center location remains at the same position as the control is resized.
autosizeSftButtonRightCenter8Right Side Center - The control is automatically resized. The right, center location remains at the same position as the control is resized.
autosizeSftButtonCenter9Center - The control is automatically resized. The center of the control remains at the same position as the control is resized.

Comments

The AutoSize property defines how the control is resized based on its contents.

If AutoSize is set to a value other than autosizeSftButtonNone, the control is automatically resized whenever its contents change, so all graphics and text components fit without being clipped.

Examples

VB.NET

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
    AxSftButtonCheck.ClickStyle = SftButtonClickStyleConstants.clickstyleSftButtonPictures
    AxSftButtonCheck.HoverStyle = SftButtonHoverStyleConstants.hoverstyleSftButtonExact

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#

{
    // 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;
    axSftButtonCheck.HoverStyle = SftButtonHoverStyleConstants.hoverstyleSftButtonExact;

C++

    // 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";
    m_vButtonCheck->ShowFocus = VARIANT_FALSE;

See Also SftButton Object | Object Hierarchy


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