Hide

SftButton/OCX 3.0 - Button Control

Display
Print

Toggle Sample (VB6)

This sample illustrates toggle buttons.

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

Option Explicit

Private Sub CloseButton_Click()
    End
End Sub

Private Sub Form_Load()
    With SftButton2
        ' you could set these at design time using the property pages
        Set .Image1Pressed.Picture = PictureOn.Picture
        Set .Image1.Picture = PictureOff.Picture
    End With
End Sub

Private Sub ChangePicture_SftButton3()
    ' Change the pictures based on the button's Pressed status
    With SftButton3
        If .Pressed Then
            Set .Image1.Picture = PictureOn.Picture
            Set .Image2.Picture = PictureOff.Picture
        Else
            Set .Image1.Picture = PictureOff.Picture
            Set .Image2.Picture = PictureOn.Picture
        End If
    End With
End Sub

Private Sub SftButton3_Click()
    ChangePicture_SftButton3
End Sub

Private Sub SftButton3_DblClick()
    ChangePicture_SftButton3
End Sub


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