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 button1 As System.Windows.Forms.Button
Friend WithEvents label1 As System.Windows.Forms.Label
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 Timer1 As System.Windows.Forms.Timer
Friend WithEvents ImageList1 As System.Windows.Forms.ImageList
Friend WithEvents BorderTimer As System.Windows.Forms.Timer
Friend WithEvents PressedTimer As System.Windows.Forms.Timer
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.button1 = New System.Windows.Forms.Button
Me.label1 = New System.Windows.Forms.Label
Me.AxSftButton1 = New AxSftButtonLib25.AxSftButton
Me.Timer1 = New System.Windows.Forms.Timer(Me.components)
Me.ImageList1 = New System.Windows.Forms.ImageList(Me.components)
Me.BorderTimer = New System.Windows.Forms.Timer(Me.components)
Me.PressedTimer = New System.Windows.Forms.Timer(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(152, 152)
Me.label3.Name = "label3"
Me.label3.Size = New System.Drawing.Size(208, 72)
Me.label3.TabIndex = 15
Me.label3.Text = "Special effects are easily implemented. These examples use a simple timer to upd" & _
"ate certain control properties."
'
'label2
'
Me.label2.Location = New System.Drawing.Point(152, 48)
Me.label2.Name = "label2"
Me.label2.Size = New System.Drawing.Size(208, 64)
Me.label2.TabIndex = 14
Me.label2.Text = "Move the mouse cursor over the button on the left and you'll notice how the text " & _
"is underlined."
'
'AxSftButton4
'
Me.AxSftButton4.Location = New System.Drawing.Point(16, 224)
Me.AxSftButton4.Name = "AxSftButton4"
Me.AxSftButton4.OcxState = CType(resources.GetObject("AxSftButton4.OcxState"), System.Windows.Forms.AxHost.State)
Me.AxSftButton4.Size = New System.Drawing.Size(96, 32)
Me.AxSftButton4.TabIndex = 13
'
'AxSftButton3
'
Me.AxSftButton3.Location = New System.Drawing.Point(16, 176)
Me.AxSftButton3.Name = "AxSftButton3"
Me.AxSftButton3.OcxState = CType(resources.GetObject("AxSftButton3.OcxState"), System.Windows.Forms.AxHost.State)
Me.AxSftButton3.Size = New System.Drawing.Size(72, 28)
Me.AxSftButton3.TabIndex = 12
'
'AxSftButton2
'
Me.AxSftButton2.Location = New System.Drawing.Point(16, 96)
Me.AxSftButton2.Name = "AxSftButton2"
Me.AxSftButton2.OcxState = CType(resources.GetObject("AxSftButton2.OcxState"), System.Windows.Forms.AxHost.State)
Me.AxSftButton2.Size = New System.Drawing.Size(104, 56)
Me.AxSftButton2.TabIndex = 11
'
'button1
'
Me.button1.DialogResult = System.Windows.Forms.DialogResult.Cancel
Me.button1.FlatStyle = System.Windows.Forms.FlatStyle.System
Me.button1.Location = New System.Drawing.Point(304, 8)
Me.button1.Name = "button1"
Me.button1.Size = New System.Drawing.Size(72, 24)
Me.button1.TabIndex = 20
Me.button1.Text = "Close"
'
'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(8, 8)
Me.label1.Name = "label1"
Me.label1.Size = New System.Drawing.Size(280, 24)
Me.label1.TabIndex = 9
Me.label1.Text = "SftButton/OCX And Special Effects"
'
'AxSftButton1
'
Me.AxSftButton1.Location = New System.Drawing.Point(16, 48)
Me.AxSftButton1.Name = "AxSftButton1"
Me.AxSftButton1.OcxState = CType(resources.GetObject("AxSftButton1.OcxState"), System.Windows.Forms.AxHost.State)
Me.AxSftButton1.Size = New System.Drawing.Size(104, 28)
Me.AxSftButton1.TabIndex = 8
'
'Timer1
'
Me.Timer1.Enabled = True
Me.Timer1.Interval = 200
'
'ImageList1
'
Me.ImageList1.ImageSize = New System.Drawing.Size(32, 32)
Me.ImageList1.ImageStream = CType(resources.GetObject("ImageList1.ImageStream"), System.Windows.Forms.ImageListStreamer)
Me.ImageList1.TransparentColor = System.Drawing.Color.White
'
'BorderTimer
'
Me.BorderTimer.Enabled = True
Me.BorderTimer.Interval = 300
'
'PressedTimer
'
Me.PressedTimer.Enabled = True
Me.PressedTimer.Interval = 500
'
'Form1
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.CancelButton = Me.button1
Me.ClientSize = New System.Drawing.Size(384, 278)
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.button1)
Me.Controls.Add(Me.label1)
Me.Controls.Add(Me.AxSftButton1)
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. - Special 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 WorldIndex As Integer = 0
Private Sub SetImage()
' Update the button with the next image in the image list
' to get the spinning globe effect
AxSftButton2.Image1.NETImageObject = ImageList1.Images(WorldIndex)
WorldIndex = WorldIndex + 1
If WorldIndex >= ImageList1.Images.Count() Then WorldIndex = 0
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
' Update the button bitmap every so often to get the
' spinning globe effect
SetImage()
End Sub
Private Sub AxSftButton1_HoverOn(ByVal sender As Object, ByVal e As System.EventArgs) Handles AxSftButton1.HoverOn
' The cursor is over the button, change the font
' and button text
AxSftButton1.Font = New Font(AxSftButton1.Font, FontStyle.Underline)
AxSftButton1.Text = "Click Me, Please"
End Sub
Private Sub AxSftButton1_HoverOff(ByVal sender As Object, ByVal e As System.EventArgs) Handles AxSftButton1.HoverOff
' The cursor has left the button, change the font
' and button text back to their original settings
AxSftButton1.Font = New Font(AxSftButton1.Font, FontStyle.Regular)
AxSftButton1.Text = "Click Me"
End Sub
Private Sub BorderTimer_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BorderTimer.Tick
' Change the button border
If AxSftButton3.Pressed Or Color.op_Inequality(AxSftButton3.DarkEdgeColor, SystemColors.ControlDarkDark) Then
AxSftButton3.DarkEdgeColor = SystemColors.ControlDarkDark
AxSftButton3.ShadowEdgeColor = SystemColors.ControlDark
AxSftButton3.LightEdgeColor = SystemColors.ControlLight
AxSftButton3.WhiteEdgeColor = SystemColors.ControlLightLight
Else
AxSftButton3.DarkEdgeColor = SystemColors.ControlLightLight
AxSftButton3.ShadowEdgeColor = SystemColors.ControlLightLight
AxSftButton3.LightEdgeColor = SystemColors.ControlLightLight
AxSftButton3.WhiteEdgeColor = SystemColors.ControlLightLight
End If
End Sub
Private Sub PressedTimer_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PressedTimer.Tick
' Toggle the button and drop down button state
If AxSftButton4.Pressed Then
If AxSftButton4.DropDownPressed Then
AxSftButton4.Pressed = False
Else
AxSftButton4.DropDownPressed = True
End If
Else
If AxSftButton4.DropDownPressed Then
AxSftButton4.DropDownPressed = False
Else
AxSftButton4.Pressed = True
End If
End If
End Sub
End Class