' TrackBar Project ' Show how a TrackBar control works. Important properties are ' Value, Minimum, Maximum, LargeChange, SmallChange, TickFrequency. 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 Label1 As System.Windows.Forms.Label Friend WithEvents Label2 As System.Windows.Forms.Label Friend WithEvents trkTemp As System.Windows.Forms.TrackBar Friend WithEvents txtTemp As System.Windows.Forms.TextBox Private Sub InitializeComponent() Me.trkTemp = New System.Windows.Forms.TrackBar Me.Label1 = New System.Windows.Forms.Label Me.Label2 = New System.Windows.Forms.Label Me.txtTemp = New System.Windows.Forms.TextBox CType(Me.trkTemp, System.ComponentModel.ISupportInitialize).BeginInit() Me.SuspendLayout() ' 'trkTemp ' Me.trkTemp.Location = New System.Drawing.Point(32, 32) Me.trkTemp.Maximum = 212 Me.trkTemp.Minimum = 32 Me.trkTemp.Name = "trkTemp" Me.trkTemp.Size = New System.Drawing.Size(224, 45) Me.trkTemp.TabIndex = 0 Me.trkTemp.TickFrequency = 10 Me.trkTemp.Value = 32 ' 'Label1 ' Me.Label1.Font = New System.Drawing.Font("Microsoft Sans Serif", 14.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Label1.Location = New System.Drawing.Point(216, 80) Me.Label1.Name = "Label1" Me.Label1.Size = New System.Drawing.Size(48, 32) Me.Label1.TabIndex = 1 Me.Label1.Text = "212" ' 'Label2 ' Me.Label2.Font = New System.Drawing.Font("Microsoft Sans Serif", 14.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Label2.Location = New System.Drawing.Point(32, 80) Me.Label2.Name = "Label2" Me.Label2.Size = New System.Drawing.Size(48, 32) Me.Label2.TabIndex = 2 Me.Label2.Text = "32" ' 'txtTemp ' Me.txtTemp.Font = New System.Drawing.Font("Microsoft Sans Serif", 14.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.txtTemp.Location = New System.Drawing.Point(120, 112) Me.txtTemp.Name = "txtTemp" Me.txtTemp.Size = New System.Drawing.Size(48, 29) Me.txtTemp.TabIndex = 3 Me.txtTemp.Text = "32" Me.txtTemp.TextAlign = System.Windows.Forms.HorizontalAlignment.Right ' 'Form1 ' Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13) Me.ClientSize = New System.Drawing.Size(292, 182) Me.Controls.Add(Me.txtTemp) Me.Controls.Add(Me.Label2) Me.Controls.Add(Me.Label1) Me.Controls.Add(Me.trkTemp) Me.Name = "Form1" Me.Text = "TrackBar Example" CType(Me.trkTemp, System.ComponentModel.ISupportInitialize).EndInit() Me.ResumeLayout(False) End Sub #End Region Private Sub trkTemp_Scroll(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles trkTemp.Scroll txtTemp.Text = trkTemp.Value End Sub End Class