Hide

SftButton/OCX 3.0 - Button Control

Display
Print

Toggle Sample (C#)

This sample illustrates toggle buttons.

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

private void button1_Click(object sender, System.EventArgs e)
{
    Application.Exit();
}

private void ChangePicture_Button3()
{
    // Change the pictures based on the button's Pressed status
    if (axSftButton3.Pressed)
    {
        axSftButton3.Image1.NETImageObject = imageList1.Images[1];
        axSftButton3.Image2.NETImageObject = imageList1.Images[0];
    } else {
        axSftButton3.Image1.NETImageObject = imageList1.Images[0];
        axSftButton3.Image2.NETImageObject = imageList1.Images[1];
    }
}

private void axSftButton3_ClickEvent(object sender, System.EventArgs e)
{
    ChangePicture_Button3();
}

private void axSftButton3_DblClick(object sender, System.EventArgs e)
{
    ChangePicture_Button3();
}

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