VScrollBar.Scroll : VScrollBar « System.Windows.Forms « VB.Net by API

Home
VB.Net by API
1.Microsoft.VisualBasic
2.Microsoft.Win32
3.System
4.System.Collections
5.System.Collections.Generic
6.System.Collections.Specialized
7.System.ComponentModel
8.System.Configuration.ConfigurationSettings
9.System.Data
10.System.Data.Odbc
11.System.Data.OleDb
12.System.Data.OracleClient
13.System.Data.SqlClient
14.System.Diagnostics
15.System.Drawing
16.System.Drawing.Drawing2D
17.System.Drawing.Imaging
18.System.Drawing.Printing
19.System.Drawing.Text
20.System.Globalization
21.System.IO
22.System.IO.IsolatedStorage
23.System.IO.Ports
24.System.Media
25.System.Messaging
26.System.Net
27.System.Net.Sockets
28.System.Reflection
29.System.Runtime.InteropServices
30.System.Runtime.Remoting.Channels
31.System.Runtime.Serialization
32.System.Runtime.Serialization.Formatters.Binary
33.System.Runtime.Serialization.Formatters.Soap
34.System.Security.Cryptography
35.System.Security.Cryptography.X509Certificates
36.System.Security.Permissions
37.System.Security.Principal
38.System.ServiceProcess
39.System.Text
40.System.Text.RegularExpressions
41.System.Threading
42.System.Web
43.System.Web.Mail
44.System.Windows.Forms
45.System.Xml
46.System.Xml.Schema
47.System.Xml.Serialization
48.System.Xml.Xsl
VB.Net
VB.Net Tutorial
VB.Net by API » System.Windows.Forms » VScrollBar 
VScrollBar.Scroll
  
Imports System.Drawing
Imports System.Drawing.Drawing2D
Imports System.Windows.Forms

public class ScrollBarControl
   public Shared Sub Main
        Application.Run(New Form1)
   End Sub
End class

Public Class Form1
    Inherits System.Windows.Forms.Form

    Public Sub New()
        MyBase.New()

        InitializeComponent()

    End Sub

    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
        If disposing Then
            If Not (components Is NothingThen
                components.Dispose()
            End If
        End If
        MyBase.Dispose(disposing)
    End Sub

    Private components As System.ComponentModel.IContainer

    Friend WithEvents HScrollBar1 As System.Windows.Forms.HScrollBar
    Friend WithEvents VScrollBar1 As System.Windows.Forms.VScrollBar
    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
    <System.Diagnostics.DebuggerStepThrough()Private Sub InitializeComponent()
        Me.HScrollBar1 = New System.Windows.Forms.HScrollBar
        Me.VScrollBar1 = New System.Windows.Forms.VScrollBar
        Me.Label1 = New System.Windows.Forms.Label
        Me.Label2 = New System.Windows.Forms.Label
        Me.Label3 = New System.Windows.Forms.Label
        Me.Label4 = New System.Windows.Forms.Label
        Me.Label5 = New System.Windows.Forms.Label
        Me.SuspendLayout()
        '
        'HScrollBar1
        '
        Me.HScrollBar1.Location = New System.Drawing.Point(24208)
        Me.HScrollBar1.Name = "HScrollBar1"
        Me.HScrollBar1.Size = New System.Drawing.Size(17616)
        Me.HScrollBar1.TabIndex = 2
        Me.HScrollBar1.Value = 50
        '
        'VScrollBar1
        '
        Me.VScrollBar1.LargeChange = 1
        Me.VScrollBar1.Location = New System.Drawing.Point(20832)
        Me.VScrollBar1.Maximum = 3
        Me.VScrollBar1.Name = "VScrollBar1"
        Me.VScrollBar1.Size = New System.Drawing.Size(16168)
        Me.VScrollBar1.TabIndex = 3
        '
        'Label1
        '
        Me.Label1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D
        Me.Label1.Location = New System.Drawing.Point(2432)
        Me.Label1.Name = "Label1"
        Me.Label1.Size = New System.Drawing.Size(176168)
        Me.Label1.TabIndex = 4
        Me.Label1.Text = "Visual Basic"
        '
        'Label2
        '
        Me.Label2.Location = New System.Drawing.Point(88240)
        Me.Label2.Name = "Label2"
        Me.Label2.Size = New System.Drawing.Size(5616)
        Me.Label2.TabIndex = 5
        Me.Label2.Text = "Font Size"
        '
        'Label3
        '
        Me.Label3.Location = New System.Drawing.Point(23248)
        Me.Label3.Name = "Label3"
        Me.Label3.Size = New System.Drawing.Size(4824)
        Me.Label3.TabIndex = 6
        Me.Label3.Text = "Red"
        '
        'Label4
        '
        Me.Label4.Location = New System.Drawing.Point(23296)
        Me.Label4.Name = "Label4"
        Me.Label4.Size = New System.Drawing.Size(4824)
        Me.Label4.TabIndex = 7
        Me.Label4.Text = "Yellow"
        '
        'Label5
        '
        Me.Label5.Location = New System.Drawing.Point(232152)
        Me.Label5.Name = "Label5"
        Me.Label5.Size = New System.Drawing.Size(4016)
        Me.Label5.TabIndex = 8
        Me.Label5.Text = "Green"
        '
        'Form1
        '
        Me.AutoScaleBaseSize = New System.Drawing.Size(513)
        Me.ClientSize = New System.Drawing.Size(292266)
        Me.Controls.Add(Me.Label5)
        Me.Controls.Add(Me.Label4)
        Me.Controls.Add(Me.Label3)
        Me.Controls.Add(Me.Label2)
        Me.Controls.Add(Me.Label1)
        Me.Controls.Add(Me.VScrollBar1)
        Me.Controls.Add(Me.HScrollBar1)
        Me.Name = "Form1"
        Me.Text = "Form1"
        Me.ResumeLayout(False)

    End Sub


    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgsHandles MyBase.Load

    End Sub

    Private Sub HScrollBar1_Scroll(ByVal sender As System.Object, ByVal e As System.Windows.Forms.ScrollEventArgsHandles HScrollBar1.Scroll
        Label1.Font = New Font(Label1.Font.FontFamily, HScrollBar1.Value)
    End Sub

    Private Sub VScrollBar1_Scroll(ByVal sender As System.Object, ByVal e As System.Windows.Forms.ScrollEventArgsHandles VScrollBar1.Scroll
        Select Case VScrollBar1.Value
            Case 1
                Label1.ForeColor = Color.Red
            Case 2
                Label1.ForeColor = Color.Yellow
            Case 3
                Label1.ForeColor = Color.Green
        End Select
    End Sub
End Class

   
    
  
Related examples in the same category
1.VScrollBar.LargeChange
2.VScrollBar.Maximum
3.VScrollBar.Minimum
4.VScrollBar.SmallChange
5.VScrollBar.ValueChanged
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.