📄 form1.vb
字号:
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
Friend WithEvents TrackBar1 As System.Windows.Forms.TrackBar
Friend WithEvents Label1 As System.Windows.Forms.Label
Friend WithEvents Label2 As System.Windows.Forms.Label
Friend WithEvents Label3 As System.Windows.Forms.Label
Friend WithEvents Label4 As System.Windows.Forms.Label
Friend WithEvents Label5 As System.Windows.Forms.Label
Friend WithEvents Label6 As System.Windows.Forms.Label
Friend WithEvents Label7 As System.Windows.Forms.Label
Friend WithEvents Label8 As System.Windows.Forms.Label
Friend WithEvents Label9 As System.Windows.Forms.Label
Friend WithEvents Label10 As System.Windows.Forms.Label
Friend WithEvents Label11 As System.Windows.Forms.Label
Friend WithEvents lblInches As System.Windows.Forms.Label
'Required by the Windows Form Designer
Private components As System.ComponentModel.Container
'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.
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.Label7 = New System.Windows.Forms.Label()
Me.Label11 = New System.Windows.Forms.Label()
Me.Label1 = New System.Windows.Forms.Label()
Me.Label2 = New System.Windows.Forms.Label()
Me.Label3 = New System.Windows.Forms.Label()
Me.Label10 = New System.Windows.Forms.Label()
Me.lblInches = New System.Windows.Forms.Label()
Me.TrackBar1 = New System.Windows.Forms.TrackBar()
Me.Label8 = New System.Windows.Forms.Label()
Me.Label9 = New System.Windows.Forms.Label()
Me.Label4 = New System.Windows.Forms.Label()
Me.Label5 = New System.Windows.Forms.Label()
Me.Label6 = New System.Windows.Forms.Label()
CType(Me.TrackBar1, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'
'Label7
'
Me.Label7.Font = New System.Drawing.Font("Microsoft Sans Serif", 11.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label7.Location = New System.Drawing.Point(264, 40)
Me.Label7.Name = "Label7"
Me.Label7.Size = New System.Drawing.Size(16, 23)
Me.Label7.TabIndex = 1
Me.Label7.Text = "6"
'
'Label11
'
Me.Label11.Font = New System.Drawing.Font("Microsoft Sans Serif", 11.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label11.Location = New System.Drawing.Point(416, 40)
Me.Label11.Name = "Label11"
Me.Label11.Size = New System.Drawing.Size(24, 23)
Me.Label11.TabIndex = 1
Me.Label11.Text = "10"
'
'Label1
'
Me.Label1.Font = New System.Drawing.Font("Microsoft Sans Serif", 11.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label1.Location = New System.Drawing.Point(16, 40)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(16, 23)
Me.Label1.TabIndex = 1
Me.Label1.Text = "0"
'
'Label2
'
Me.Label2.Font = New System.Drawing.Font("Microsoft Sans Serif", 11.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label2.Location = New System.Drawing.Point(56, 40)
Me.Label2.Name = "Label2"
Me.Label2.Size = New System.Drawing.Size(16, 23)
Me.Label2.TabIndex = 1
Me.Label2.Text = "1"
'
'Label3
'
Me.Label3.Font = New System.Drawing.Font("Microsoft Sans Serif", 11.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label3.Location = New System.Drawing.Point(96, 40)
Me.Label3.Name = "Label3"
Me.Label3.Size = New System.Drawing.Size(16, 23)
Me.Label3.TabIndex = 1
Me.Label3.Text = "2"
'
'Label10
'
Me.Label10.Font = New System.Drawing.Font("Microsoft Sans Serif", 11.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label10.Location = New System.Drawing.Point(384, 40)
Me.Label10.Name = "Label10"
Me.Label10.Size = New System.Drawing.Size(16, 23)
Me.Label10.TabIndex = 1
Me.Label10.Text = "9"
'
'lblInches
'
Me.lblInches.Font = New System.Drawing.Font("Verdana", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.lblInches.Location = New System.Drawing.Point(16, 80)
Me.lblInches.Name = "lblInches"
Me.lblInches.Size = New System.Drawing.Size(232, 23)
Me.lblInches.TabIndex = 4
'
'TrackBar1
'
Me.TrackBar1.Location = New System.Drawing.Point(8, 8)
Me.TrackBar1.Maximum = 50
Me.TrackBar1.Name = "TrackBar1"
Me.TrackBar1.Size = New System.Drawing.Size(440, 42)
Me.TrackBar1.TabIndex = 0
Me.TrackBar1.TickFrequency = 5
'
'Label8
'
Me.Label8.Font = New System.Drawing.Font("Microsoft Sans Serif", 11.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label8.Location = New System.Drawing.Point(304, 40)
Me.Label8.Name = "Label8"
Me.Label8.Size = New System.Drawing.Size(16, 23)
Me.Label8.TabIndex = 1
Me.Label8.Text = "7"
'
'Label9
'
Me.Label9.Font = New System.Drawing.Font("Microsoft Sans Serif", 11.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label9.Location = New System.Drawing.Point(344, 40)
Me.Label9.Name = "Label9"
Me.Label9.Size = New System.Drawing.Size(16, 23)
Me.Label9.TabIndex = 1
Me.Label9.Text = "8"
'
'Label4
'
Me.Label4.Font = New System.Drawing.Font("Microsoft Sans Serif", 11.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label4.Location = New System.Drawing.Point(136, 40)
Me.Label4.Name = "Label4"
Me.Label4.Size = New System.Drawing.Size(16, 23)
Me.Label4.TabIndex = 3
Me.Label4.Text = "3"
'
'Label5
'
Me.Label5.Font = New System.Drawing.Font("Microsoft Sans Serif", 11.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label5.Location = New System.Drawing.Point(176, 40)
Me.Label5.Name = "Label5"
Me.Label5.Size = New System.Drawing.Size(16, 23)
Me.Label5.TabIndex = 1
Me.Label5.Text = "4"
'
'Label6
'
Me.Label6.Font = New System.Drawing.Font("Microsoft Sans Serif", 11.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label6.Location = New System.Drawing.Point(224, 40)
Me.Label6.Name = "Label6"
Me.Label6.Size = New System.Drawing.Size(16, 23)
Me.Label6.TabIndex = 1
Me.Label6.Text = "5"
'
'Form1
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.ClientSize = New System.Drawing.Size(448, 117)
Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.lblInches, Me.Label11, Me.Label10, Me.Label9, Me.Label8, Me.Label7, Me.Label6, Me.Label5, Me.Label4, Me.Label3, Me.Label2, Me.Label1, Me.TrackBar1})
Me.Name = "Form1"
Me.Text = "Inches"
CType(Me.TrackBar1, System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False)
End Sub
#End Region
Private Sub Label_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) _
Handles Label1.Click, Label2.Click, _
Label3.Click, Label4.Click, Label5.Click, Label6.Click, _
Label7.Click, Label8.Click, Label9.Click
TrackBar1.Value = sender.Text * 5
' If Option Strict = On then change the last statement to:
'
' TrackBar1.Value = CInt(CType(sender, Label).Text) * 5
'
End Sub
Private Sub TrackBar1_ValueChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles TrackBar1.ValueChanged
lblInches.Text = "Length in inches = " & _
Format(TrackBar1.Value / 5, "#.00")
End Sub
End Class
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -