Hide

SftButton/OCX 3.0 - Button Control

Display
Print

Runtime Sample (VB.NET)

This sample illustrates setting design-time properties at run-time.

The source code is located at C:\Program Files (x86)\Softelvdm\SftButton OCX 3.0\Samples\Visual Studio - VB.NET\Runtime\Form1.vb or C:\Program Files\Softelvdm\SftButton OCX 3.0\Samples\Visual Studio - VB.NET\Runtime\Form1.vb (on 32-bit Windows versions).

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    '  This sample doesn't do anything "useful". Its only purpose
    ' is to provide runtime initialization of a SftButton control,
    ' so we have some code samples for the properties.

    ' It is a lot easier to set properties at design-time using
    ' the property pages. Right-click on the control, then select
    ' "Properties" from the popup menu to access the property pages.

    ' Appearance
    AxSftButton1.AVITransparent = True
    AxSftButton1.BorderAlways = True
    AxSftButton1.BorderStyle = SftButtonBorderStyleConstants.borderSftButtonStandard
    AxSftButton1.ButtonStyle = SftButtonStyleConstants.styleSftButtonDropDown
    AxSftButton1.DropDownPressed = False
    AxSftButton1.DropDownStyle = SftButtonDropDownStyleConstants.dropdownstyleSftButtonStandard
    AxSftButton1.FillOrientation = SftButtonOrientationConstants.orientationSftButtonHorizontal
    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
    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
    AxSftButton1.BackColorHoverEnd = Color.Cyan
    AxSftButton1.BackColorPressed = SystemColors.Control
    AxSftButton1.DarkEdgeColor = SystemColors.ControlDark
    AxSftButton1.ForeColor = Color.Black
    AxSftButton1.ForeColorGrayed = Color.Gray
    AxSftButton1.ForeColorDownArrow = Color.Blue
    AxSftButton1.ForeColorPressed = Color.Black
    AxSftButton1.LightEdgeColor = SystemColors.ControlLight
    AxSftButton1.ShadowEdgeColor = SystemColors.ControlDarkDark
    AxSftButton1.WhiteEdgeColor = SystemColors.ControlLightLight

End Sub

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