Imports AxSftButtonLib25
Imports SftButtonLib25
Imports Softelvdm.OLEConvert
Public Class Form1
Inherits System.Windows.Forms.Form
#Region " Windows Form Designer generated code "
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
End Sub
'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
Friend WithEvents label3 As System.Windows.Forms.Label
Friend WithEvents label2 As System.Windows.Forms.Label
Friend WithEvents label1 As System.Windows.Forms.Label
Friend WithEvents button1 As System.Windows.Forms.Button
Friend WithEvents AxSftButton4 As AxSftButtonLib25.AxSftButton
Friend WithEvents AxSftButton3 As AxSftButtonLib25.AxSftButton
Friend WithEvents AxSftButton2 As AxSftButtonLib25.AxSftButton
Friend WithEvents AxSftButton1 As AxSftButtonLib25.AxSftButton
Friend WithEvents ImageList1 As System.Windows.Forms.ImageList
Friend WithEvents SftHelperComponent1 As Softelvdm.OCXHelper.SftHelperComponent
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.components = New System.ComponentModel.Container
Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(Form1))
Me.label3 = New System.Windows.Forms.Label
Me.label2 = New System.Windows.Forms.Label
Me.AxSftButton4 = New AxSftButtonLib25.AxSftButton
Me.AxSftButton3 = New AxSftButtonLib25.AxSftButton
Me.AxSftButton2 = New AxSftButtonLib25.AxSftButton
Me.AxSftButton1 = New AxSftButtonLib25.AxSftButton
Me.label1 = New System.Windows.Forms.Label
Me.button1 = New System.Windows.Forms.Button
Me.ImageList1 = New System.Windows.Forms.ImageList(Me.components)
Me.SftHelperComponent1 = New Softelvdm.OCXHelper.SftHelperComponent(Me.components)
CType(Me.AxSftButton4, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.AxSftButton3, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.AxSftButton2, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.AxSftButton1, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'
'label3
'
Me.label3.Location = New System.Drawing.Point(151, 208)
Me.label3.Name = "label3"
Me.label3.Size = New System.Drawing.Size(184, 40)
Me.label3.TabIndex = 15
Me.label3.Text = "Even the drop down button can be used as a toggle button."
'
'label2
'
Me.label2.Location = New System.Drawing.Point(135, 40)
Me.label2.Name = "label2"
Me.label2.Size = New System.Drawing.Size(160, 32)
Me.label2.TabIndex = 14
Me.label2.Text = "Click each button to try the on/off positions."
'
'AxSftButton4
'
Me.AxSftButton4.Location = New System.Drawing.Point(23, 208)
Me.AxSftButton4.Name = "AxSftButton4"
Me.AxSftButton4.OcxState = CType(resources.GetObject("AxSftButton4.OcxState"), System.Windows.Forms.AxHost.State)
Me.AxSftButton4.Size = New System.Drawing.Size(104, 28)
Me.AxSftButton4.TabIndex = 13
'
'AxSftButton3
'
Me.AxSftButton3.Location = New System.Drawing.Point(23, 144)
Me.AxSftButton3.Name = "AxSftButton3"
Me.AxSftButton3.OcxState = CType(resources.GetObject("AxSftButton3.OcxState"), System.Windows.Forms.AxHost.State)
Me.AxSftButton3.Size = New System.Drawing.Size(176, 48)
Me.AxSftButton3.TabIndex = 12
'
'AxSftButton2
'
Me.AxSftButton2.Location = New System.Drawing.Point(23, 80)
Me.AxSftButton2.Name = "AxSftButton2"
Me.AxSftButton2.OcxState = CType(resources.GetObject("AxSftButton2.OcxState"), System.Windows.Forms.AxHost.State)
Me.AxSftButton2.Size = New System.Drawing.Size(128, 48)
Me.AxSftButton2.TabIndex = 11
'
'AxSftButton1
'
Me.AxSftButton1.Location = New System.Drawing.Point(23, 40)
Me.AxSftButton1.Name = "AxSftButton1"
Me.AxSftButton1.OcxState = CType(resources.GetObject("AxSftButton1.OcxState"), System.Windows.Forms.AxHost.State)
Me.AxSftButton1.Size = New System.Drawing.Size(80, 28)
Me.AxSftButton1.TabIndex = 10
'
'label1
'
Me.label1.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.label1.Location = New System.Drawing.Point(7, 8)
Me.label1.Name = "label1"
Me.label1.Size = New System.Drawing.Size(296, 24)
Me.label1.TabIndex = 9
Me.label1.Text = "SftButton/OCX As Toggle Button"
'
'button1
'
Me.button1.DialogResult = System.Windows.Forms.DialogResult.Cancel
Me.button1.FlatStyle = System.Windows.Forms.FlatStyle.System
Me.button1.Location = New System.Drawing.Point(311, 8)
Me.button1.Name = "button1"
Me.button1.Size = New System.Drawing.Size(56, 24)
Me.button1.TabIndex = 8
Me.button1.Text = "Close"
'
'ImageList1
'
Me.ImageList1.ImageSize = New System.Drawing.Size(30, 32)
Me.ImageList1.ImageStream = CType(resources.GetObject("ImageList1.ImageStream"), System.Windows.Forms.ImageListStreamer)
Me.ImageList1.TransparentColor = System.Drawing.Color.White
'
'Form1
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.CancelButton = Me.button1
Me.ClientSize = New System.Drawing.Size(374, 264)
Me.Controls.Add(Me.label3)
Me.Controls.Add(Me.label2)
Me.Controls.Add(Me.AxSftButton4)
Me.Controls.Add(Me.AxSftButton3)
Me.Controls.Add(Me.AxSftButton2)
Me.Controls.Add(Me.AxSftButton1)
Me.Controls.Add(Me.label1)
Me.Controls.Add(Me.button1)
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog
Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
Me.Name = "Form1"
Me.Text = "Softel vdm, Inc. - Toggle Sample"
CType(Me.AxSftButton4, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.AxSftButton3, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.AxSftButton2, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.AxSftButton1, System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False)
End Sub
#End Region
'--locate-marker--
Private Sub button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles button1.Click
Application.Exit()
End Sub
Private Sub ChangePicture_Button3()
' Change the pictures based on the button's Pressed status
If AxSftButton3.Pressed Then
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)
End If
End Sub
Private Sub axSftButton3_ClickEvent(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AxSftButton3.ClickEvent
ChangePicture_Button3()
End Sub
Private Sub axSftButton3_DblClick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AxSftButton3.DblClick
ChangePicture_Button3()
End Sub
End Class