Get TrackBar value and LargeChange value : TrackBar « GUI « VB.Net Tutorial

Home
VB.Net Tutorial
1.Language Basics
2.Data Type
3.Operator
4.Statements
5.Date Time
6.Class Module
7.Development
8.Collections
9.Generics
10.Attributes
11.Event
12.LINQ
13.Stream File
14.GUI
15.GUI Applications
16.Windows Presentation Foundation
17.2D Graphics
18.I18N Internationlization
19.Reflection
20.Regular Expressions
21.Security
22.Socket Network
23.Thread
24.Windows
25.XML
26.Database ADO.net
27.Design Patterns
VB.Net
VB.Net by API
VB.Net Tutorial » GUI » TrackBar 
14.41.1.Get TrackBar value and LargeChange value
Get TrackBar value and LargeChange value
imports System
imports System.Drawing
imports System.Windows.Forms

public class TrackBars : inherits Form
  dim htbar as TrackBar
  dim vtbar as TrackBar

  public sub New()
    Size = new Size(500,520)

    htbar = new TrackBar()
    htbar.Parent = me
    htbar.Orientation = Orientation.Horizontal
    htbar.Size = new Size(20010)
    htbar.Location = new Point(025)
    htbar.TickStyle = TickStyle.BottomRight
    htbar.TickFrequency = 25
    htbar.Minimum = 25
    htbar.Maximum = 400
    htbar.SmallChange = 10
    htbar.LargeChange = 25
    htbar.BackColor = Color.Yellow
    htbar.Value = 100
    AddHandler htbar.ValueChanged, AddressOf htbar_OnValueChanged

    vtbar = new TrackBar()
    vtbar.Parent = me
    vtbar.Orientation = Orientation.Vertical
    vtbar.Size = new Size(25300)
    vtbar.Location = new Point(2525)
    vtbar.TickStyle = TickStyle.BottomRight
    vtbar.SetRange(25,400)
    vtbar.SmallChange = 10
    vtbar.LargeChange = 50
    vtbar.TickFrequency = CInt(vtbar.Maximum / 20)
    vtbar.BackColor = Color.Pink
    vtbar.Value = 200
    AddHandler vtbar.ValueChanged, AddressOf vtbar_OnValueChanged

  end sub  '  close for constructor

  private sub htbar_OnValueChanged(ByVal sender as object, _
              ByVal e as EventArgs)
    Console.WriteLine(htbar.Value)
  end sub

  private sub vtbar_OnValueChanged(ByVal sender as object, _
              ByVal e as EventArgs)
    Console.WriteLine(vtbar.Value)
    Console.WriteLine(vtbar.LargeChange)
  end sub

  public shared sub Main() 
    Application.Run(new TrackBars())
  end sub
end class
14.41.TrackBar
14.41.1.Get TrackBar value and LargeChange valueGet TrackBar value and LargeChange value
14.41.2.Use TrackBar to control the ScaleUse TrackBar to control the Scale
14.41.3.Link ProgressBar with a TrackBarLink ProgressBar with a TrackBar
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.