Hide

SftButton/OCX 3.0 - Button Control

Display
Print

Runtime Sample (C#)

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 - CSharp\Runtime\Form1.cs or C:\Program Files\Softelvdm\SftButton OCX 3.0\Samples\Visual Studio - CSharp\Runtime\Form1.cs (on 32-bit Windows versions).

private void Form1_Load(object sender, System.EventArgs e)
{
    //  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;
}

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