<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
		<id>http://www.vbex.ru/index.php?action=history&amp;feed=atom&amp;title=VB.Net_Tutorial%2FGUI%2FScrollBar</id>
		<title>VB.Net Tutorial/GUI/ScrollBar - История изменений</title>
		<link rel="self" type="application/atom+xml" href="http://www.vbex.ru/index.php?action=history&amp;feed=atom&amp;title=VB.Net_Tutorial%2FGUI%2FScrollBar"/>
		<link rel="alternate" type="text/html" href="http://www.vbex.ru/index.php?title=VB.Net_Tutorial/GUI/ScrollBar&amp;action=history"/>
		<updated>2026-04-05T13:12:13Z</updated>
		<subtitle>История изменений этой страницы в вики</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>http://www.vbex.ru/index.php?title=VB.Net_Tutorial/GUI/ScrollBar&amp;diff=3810&amp;oldid=prev</id>
		<title> в 16:40, 26 мая 2010</title>
		<link rel="alternate" type="text/html" href="http://www.vbex.ru/index.php?title=VB.Net_Tutorial/GUI/ScrollBar&amp;diff=3810&amp;oldid=prev"/>
				<updated>2010-05-26T16:40:30Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr style=&quot;vertical-align: top;&quot; lang=&quot;ru&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Предыдущая&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Версия 16:40, 26 мая 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; style=&quot;text-align: center;&quot; lang=&quot;ru&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(нет различий)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
			</entry>

	<entry>
		<id>http://www.vbex.ru/index.php?title=VB.Net_Tutorial/GUI/ScrollBar&amp;diff=3811&amp;oldid=prev</id>
		<title>Admin: 1 версия</title>
		<link rel="alternate" type="text/html" href="http://www.vbex.ru/index.php?title=VB.Net_Tutorial/GUI/ScrollBar&amp;diff=3811&amp;oldid=prev"/>
				<updated>2010-05-26T12:56:53Z</updated>
		
		<summary type="html">&lt;p&gt;1 версия&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Scroll Bar scrolls and get its current value==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;vbnet&amp;quot;&amp;gt;Imports System.Drawing&lt;br /&gt;
Imports System.Drawing.Drawing2D&lt;br /&gt;
Imports System.Windows.Forms&lt;br /&gt;
public class ScrollBarControl&lt;br /&gt;
   public Shared Sub Main&lt;br /&gt;
        Application.Run(New Form1)&lt;br /&gt;
   End Sub&lt;br /&gt;
End class&lt;br /&gt;
Public Class Form1&lt;br /&gt;
    Inherits System.Windows.Forms.Form&lt;br /&gt;
    Public Sub New()&lt;br /&gt;
        MyBase.New()&lt;br /&gt;
        InitializeComponent()&lt;br /&gt;
    End Sub&lt;br /&gt;
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)&lt;br /&gt;
        If disposing Then&lt;br /&gt;
            If Not (components Is Nothing) Then&lt;br /&gt;
                components.Dispose()&lt;br /&gt;
            End If&lt;br /&gt;
        End If&lt;br /&gt;
        MyBase.Dispose(disposing)&lt;br /&gt;
    End Sub&lt;br /&gt;
    Private components As System.ruponentModel.IContainer&lt;br /&gt;
    Friend WithEvents HScrollBar1 As System.Windows.Forms.HScrollBar&lt;br /&gt;
    Friend WithEvents VScrollBar1 As System.Windows.Forms.VScrollBar&lt;br /&gt;
    Friend WithEvents Label1 As System.Windows.Forms.Label&lt;br /&gt;
    Friend WithEvents Label2 As System.Windows.Forms.Label&lt;br /&gt;
    Friend WithEvents Label3 As System.Windows.Forms.Label&lt;br /&gt;
    Friend WithEvents Label4 As System.Windows.Forms.Label&lt;br /&gt;
    Friend WithEvents Label5 As System.Windows.Forms.Label&lt;br /&gt;
    &amp;lt;System.Diagnostics.DebuggerStepThrough()&amp;gt; Private Sub InitializeComponent()&lt;br /&gt;
        Me.HScrollBar1 = New System.Windows.Forms.HScrollBar&lt;br /&gt;
        Me.VScrollBar1 = New System.Windows.Forms.VScrollBar&lt;br /&gt;
        Me.Label1 = New System.Windows.Forms.Label&lt;br /&gt;
        Me.Label2 = New System.Windows.Forms.Label&lt;br /&gt;
        Me.Label3 = New System.Windows.Forms.Label&lt;br /&gt;
        Me.Label4 = New System.Windows.Forms.Label&lt;br /&gt;
        Me.Label5 = New System.Windows.Forms.Label&lt;br /&gt;
        Me.SuspendLayout()&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;HScrollBar1&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.HScrollBar1.Location = New System.Drawing.Point(24, 208)&lt;br /&gt;
        Me.HScrollBar1.Name = &amp;quot;HScrollBar1&amp;quot;&lt;br /&gt;
        Me.HScrollBar1.Size = New System.Drawing.Size(176, 16)&lt;br /&gt;
        Me.HScrollBar1.TabIndex = 2&lt;br /&gt;
        Me.HScrollBar1.Value = 50&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;VScrollBar1&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.VScrollBar1.LargeChange = 1&lt;br /&gt;
        Me.VScrollBar1.Location = New System.Drawing.Point(208, 32)&lt;br /&gt;
        Me.VScrollBar1.Maximum = 3&lt;br /&gt;
        Me.VScrollBar1.Name = &amp;quot;VScrollBar1&amp;quot;&lt;br /&gt;
        Me.VScrollBar1.Size = New System.Drawing.Size(16, 168)&lt;br /&gt;
        Me.VScrollBar1.TabIndex = 3&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;Label1&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.Label1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D&lt;br /&gt;
        Me.Label1.Location = New System.Drawing.Point(24, 32)&lt;br /&gt;
        Me.Label1.Name = &amp;quot;Label1&amp;quot;&lt;br /&gt;
        Me.Label1.Size = New System.Drawing.Size(176, 168)&lt;br /&gt;
        Me.Label1.TabIndex = 4&lt;br /&gt;
        Me.Label1.Text = &amp;quot;Visual Basic&amp;quot;&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;Label2&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.Label2.Location = New System.Drawing.Point(88, 240)&lt;br /&gt;
        Me.Label2.Name = &amp;quot;Label2&amp;quot;&lt;br /&gt;
        Me.Label2.Size = New System.Drawing.Size(56, 16)&lt;br /&gt;
        Me.Label2.TabIndex = 5&lt;br /&gt;
        Me.Label2.Text = &amp;quot;Font Size&amp;quot;&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;Label3&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.Label3.Location = New System.Drawing.Point(232, 48)&lt;br /&gt;
        Me.Label3.Name = &amp;quot;Label3&amp;quot;&lt;br /&gt;
        Me.Label3.Size = New System.Drawing.Size(48, 24)&lt;br /&gt;
        Me.Label3.TabIndex = 6&lt;br /&gt;
        Me.Label3.Text = &amp;quot;Red&amp;quot;&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;Label4&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.Label4.Location = New System.Drawing.Point(232, 96)&lt;br /&gt;
        Me.Label4.Name = &amp;quot;Label4&amp;quot;&lt;br /&gt;
        Me.Label4.Size = New System.Drawing.Size(48, 24)&lt;br /&gt;
        Me.Label4.TabIndex = 7&lt;br /&gt;
        Me.Label4.Text = &amp;quot;Yellow&amp;quot;&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;Label5&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.Label5.Location = New System.Drawing.Point(232, 152)&lt;br /&gt;
        Me.Label5.Name = &amp;quot;Label5&amp;quot;&lt;br /&gt;
        Me.Label5.Size = New System.Drawing.Size(40, 16)&lt;br /&gt;
        Me.Label5.TabIndex = 8&lt;br /&gt;
        Me.Label5.Text = &amp;quot;Green&amp;quot;&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;Form1&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)&lt;br /&gt;
        Me.ClientSize = New System.Drawing.Size(292, 266)&lt;br /&gt;
        Me.Controls.Add(Me.Label5)&lt;br /&gt;
        Me.Controls.Add(Me.Label4)&lt;br /&gt;
        Me.Controls.Add(Me.Label3)&lt;br /&gt;
        Me.Controls.Add(Me.Label2)&lt;br /&gt;
        Me.Controls.Add(Me.Label1)&lt;br /&gt;
        Me.Controls.Add(Me.VScrollBar1)&lt;br /&gt;
        Me.Controls.Add(Me.HScrollBar1)&lt;br /&gt;
        Me.Name = &amp;quot;Form1&amp;quot;&lt;br /&gt;
        Me.Text = &amp;quot;Form1&amp;quot;&lt;br /&gt;
        Me.ResumeLayout(False)&lt;br /&gt;
    End Sub&lt;br /&gt;
&lt;br /&gt;
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load&lt;br /&gt;
    End Sub&lt;br /&gt;
    Private Sub HScrollBar1_Scroll(ByVal sender As System.Object, ByVal e As System.Windows.Forms.ScrollEventArgs) Handles HScrollBar1.Scroll&lt;br /&gt;
        Label1.Font = New Font(Label1.Font.FontFamily, HScrollBar1.Value)&lt;br /&gt;
    End Sub&lt;br /&gt;
    Private Sub VScrollBar1_Scroll(ByVal sender As System.Object, ByVal e As System.Windows.Forms.ScrollEventArgs) Handles VScrollBar1.Scroll&lt;br /&gt;
        Select Case VScrollBar1.Value&lt;br /&gt;
            Case 1&lt;br /&gt;
                Label1.ForeColor = Color.Red&lt;br /&gt;
            Case 2&lt;br /&gt;
                Label1.ForeColor = Color.Yellow&lt;br /&gt;
            Case 3&lt;br /&gt;
                Label1.ForeColor = Color.Green&lt;br /&gt;
        End Select&lt;br /&gt;
    End Sub&lt;br /&gt;
End Class&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Use ScollBar to control font size==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;vbnet&amp;quot;&amp;gt;Imports System.Windows.Forms&lt;br /&gt;
public class ScrollBarControlFontSize&lt;br /&gt;
   public Shared Sub Main&lt;br /&gt;
        Application.Run(New Form1)&lt;br /&gt;
   End Sub&lt;br /&gt;
End class&lt;br /&gt;
&lt;br /&gt;
Public Class Form1&lt;br /&gt;
    &lt;br /&gt;
    Private Sub HScrollBar1_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles HScrollBar1.ValueChanged&lt;br /&gt;
        Dim mysize As Integer&lt;br /&gt;
        mysize = HScrollBar1.Value&lt;br /&gt;
        TextBox1.Font = New System.Drawing.Font(&amp;quot;&amp;quot;, mysize)&lt;br /&gt;
    End Sub&lt;br /&gt;
End Class&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Global.Microsoft.VisualBasic.rupilerServices.DesignerGenerated()&amp;gt; _&lt;br /&gt;
Partial Class Form1&lt;br /&gt;
    Inherits System.Windows.Forms.Form&lt;br /&gt;
    &amp;quot;Form overrides dispose to clean up the component list.&lt;br /&gt;
    &amp;lt;System.Diagnostics.DebuggerNonUserCode()&amp;gt; _&lt;br /&gt;
    Protected Overrides Sub Dispose(ByVal disposing As Boolean)&lt;br /&gt;
        If disposing AndAlso components IsNot Nothing Then&lt;br /&gt;
            components.Dispose()&lt;br /&gt;
        End If&lt;br /&gt;
        MyBase.Dispose(disposing)&lt;br /&gt;
    End Sub&lt;br /&gt;
    &amp;quot;Required by the Windows Form Designer&lt;br /&gt;
    Private components As System.ruponentModel.IContainer&lt;br /&gt;
    &amp;quot;NOTE: The following procedure is required by the Windows Form Designer&lt;br /&gt;
    &amp;quot;It can be modified using the Windows Form Designer.  &lt;br /&gt;
    &amp;quot;Do not modify it using the code editor.&lt;br /&gt;
    &amp;lt;System.Diagnostics.DebuggerStepThrough()&amp;gt; _&lt;br /&gt;
    Private Sub InitializeComponent()&lt;br /&gt;
        Me.HScrollBar1 = New System.Windows.Forms.HScrollBar&lt;br /&gt;
        Me.TextBox1 = New System.Windows.Forms.TextBox&lt;br /&gt;
        Me.Label1 = New System.Windows.Forms.Label&lt;br /&gt;
        Me.SuspendLayout()&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;HScrollBar1&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.HScrollBar1.LargeChange = 5&lt;br /&gt;
        Me.HScrollBar1.Location = New System.Drawing.Point(23, 145)&lt;br /&gt;
        Me.HScrollBar1.Maximum = 55&lt;br /&gt;
        Me.HScrollBar1.Minimum = 5&lt;br /&gt;
        Me.HScrollBar1.Name = &amp;quot;HScrollBar1&amp;quot;&lt;br /&gt;
        Me.HScrollBar1.Size = New System.Drawing.Size(330, 21)&lt;br /&gt;
        Me.HScrollBar1.TabIndex = 1&lt;br /&gt;
        Me.HScrollBar1.Value = 5&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;TextBox1&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.TextBox1.Location = New System.Drawing.Point(18, 14)&lt;br /&gt;
        Me.TextBox1.Multiline = True&lt;br /&gt;
        Me.TextBox1.Name = &amp;quot;TextBox1&amp;quot;&lt;br /&gt;
        Me.TextBox1.Size = New System.Drawing.Size(334, 101)&lt;br /&gt;
        Me.TextBox1.TabIndex = 2&lt;br /&gt;
        Me.TextBox1.Text = &amp;quot;www.vbex.ru&amp;quot;&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;Label1&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.Label1.AutoSize = True&lt;br /&gt;
        Me.Label1.Location = New System.Drawing.Point(25, 125)&lt;br /&gt;
        Me.Label1.Name = &amp;quot;Label1&amp;quot;&lt;br /&gt;
        Me.Label1.Size = New System.Drawing.Size(53, 12)&lt;br /&gt;
        Me.Label1.TabIndex = 3&lt;br /&gt;
        Me.Label1.Text = &amp;quot;Font Size&amp;quot;&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;Form1&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 12.0!)&lt;br /&gt;
        Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font&lt;br /&gt;
        Me.ClientSize = New System.Drawing.Size(378, 175)&lt;br /&gt;
        Me.Controls.Add(Me.Label1)&lt;br /&gt;
        Me.Controls.Add(Me.TextBox1)&lt;br /&gt;
        Me.Controls.Add(Me.HScrollBar1)&lt;br /&gt;
        Me.Name = &amp;quot;Form1&amp;quot;&lt;br /&gt;
        Me.Text = &amp;quot;Form1&amp;quot;&lt;br /&gt;
        Me.ResumeLayout(False)&lt;br /&gt;
        Me.PerformLayout()&lt;br /&gt;
    End Sub&lt;br /&gt;
    Friend WithEvents HScrollBar1 As System.Windows.Forms.HScrollBar&lt;br /&gt;
    Friend WithEvents TextBox1 As System.Windows.Forms.TextBox&lt;br /&gt;
    Friend WithEvents Label1 As System.Windows.Forms.Label&lt;br /&gt;
End Class&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Use ScrollBars to control the scroll of an Image==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;vbnet&amp;quot;&amp;gt;imports System&lt;br /&gt;
imports System.Drawing&lt;br /&gt;
imports System.Windows.Forms&lt;br /&gt;
public class ScrollBars : inherits Form&lt;br /&gt;
  dim pnl as Panel&lt;br /&gt;
  dim pb as PictureBox&lt;br /&gt;
  dim hbar as HScrollBar&lt;br /&gt;
  dim vbar as VScrollBar&lt;br /&gt;
  dim img as Image&lt;br /&gt;
  public sub New()&lt;br /&gt;
    Size = new Size(480,300)&lt;br /&gt;
    img = Image.FromFile(&amp;quot;yourfile.jpg&amp;quot;)&lt;br /&gt;
    pnl = new Panel()&lt;br /&gt;
    pnl.Parent = me&lt;br /&gt;
    pnl.Size = new Size(400,200)&lt;br /&gt;
    pnl.Location = new Point(10,10)&lt;br /&gt;
    pnl.BorderStyle = BorderStyle.FixedSingle&lt;br /&gt;
    pb = new PictureBox()&lt;br /&gt;
    pb.Parent = pnl&lt;br /&gt;
    pb.Size = new Size(img.Size.Width, img.Size.Height)&lt;br /&gt;
    pb.Location = new Point(0, 0)&lt;br /&gt;
    pb.SizeMode = PictureBoxSizeMode.CenterImage&lt;br /&gt;
    pb.Image = img&lt;br /&gt;
    hbar = new HScrollBar()&lt;br /&gt;
    hbar.Parent = me&lt;br /&gt;
    hbar.Location = new Point(pnl.Left, pnl.Bottom + 25)&lt;br /&gt;
    hbar.Size = new Size(pnl.Width, 25)&lt;br /&gt;
    hbar.Minimum = 0&lt;br /&gt;
    hbar.Maximum = 100&lt;br /&gt;
    hbar.SmallChange = 1&lt;br /&gt;
    hbar.LargeChange = 10&lt;br /&gt;
    hbar.Value = 10&lt;br /&gt;
    AddHandler hbar.ValueChanged, AddressOf hbar_OnValueChanged&lt;br /&gt;
    vbar = new VScrollBar()&lt;br /&gt;
    vbar.Parent = me&lt;br /&gt;
    vbar.Location = new Point(pnl.Right + 25, pnl.Top)&lt;br /&gt;
    vbar.Size = new Size(25, pnl.Height)&lt;br /&gt;
    vbar.Minimum = 0&lt;br /&gt;
    vbar.Maximum = 100&lt;br /&gt;
    vbar.SmallChange = 1&lt;br /&gt;
    vbar.LargeChange = 10&lt;br /&gt;
    vbar.Value = CType((vbar.Maximum - vbar.Minimum) / 2, integer)&lt;br /&gt;
    AddHandler vbar.ValueChanged, AddressOf vbar_OnValueChanged&lt;br /&gt;
  end sub  &amp;quot;  close for constructor&lt;br /&gt;
  private sub hbar_OnValueChanged(ByVal sender as object,ByVal e as EventArgs)&lt;br /&gt;
    pb.Location = new Point(CType((pnl.Size.Width - img.Size.Width) * _&lt;br /&gt;
      hbar.Value /(hbar.Maximum - hbar.LargeChange + 1), integer), _&lt;br /&gt;
      pb.Top)&lt;br /&gt;
  end sub&lt;br /&gt;
  private sub vbar_OnValueChanged(ByVal sender as object,ByVal e as EventArgs)&lt;br /&gt;
    pb.Location = new Point(pb.Left, _&lt;br /&gt;
      CType((pnl.Size.Height - img.Size.Height) * _&lt;br /&gt;
      vbar.Value / (vbar.Maximum - vbar.LargeChange + 1), integer))&lt;br /&gt;
  end sub&lt;br /&gt;
  public shared sub Main() &lt;br /&gt;
    Application.Run(new ScrollBars())&lt;br /&gt;
  end sub&lt;br /&gt;
end class&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Use ScrollBar to control the image scroll in a PictureBox==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;vbnet&amp;quot;&amp;gt;Imports System.Drawing&lt;br /&gt;
Imports System.Drawing.Drawing2D&lt;br /&gt;
Imports System.Windows.Forms&lt;br /&gt;
public class UseScrollBarToControlTheScrollingOfAnImage&lt;br /&gt;
   public Shared Sub Main&lt;br /&gt;
        Application.Run(New Form1)&lt;br /&gt;
   End Sub&lt;br /&gt;
End class&lt;br /&gt;
Public Class Form1&lt;br /&gt;
    Inherits System.Windows.Forms.Form&lt;br /&gt;
#Region &amp;quot; Windows Form Designer generated code &amp;quot;&lt;br /&gt;
    Public Sub New()&lt;br /&gt;
        MyBase.New()&lt;br /&gt;
        &amp;quot;This call is required by the Windows Form Designer.&lt;br /&gt;
        InitializeComponent()&lt;br /&gt;
        &amp;quot;Add any initialization after the InitializeComponent() call&lt;br /&gt;
    End Sub&lt;br /&gt;
    &amp;quot;Form overrides dispose to clean up the component list.&lt;br /&gt;
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)&lt;br /&gt;
        If disposing Then&lt;br /&gt;
            If Not (components Is Nothing) Then&lt;br /&gt;
                components.Dispose()&lt;br /&gt;
            End If&lt;br /&gt;
        End If&lt;br /&gt;
        MyBase.Dispose(disposing)&lt;br /&gt;
    End Sub&lt;br /&gt;
    &amp;quot;Required by the Windows Form Designer&lt;br /&gt;
    Private components As System.ruponentModel.IContainer&lt;br /&gt;
    &amp;quot;NOTE: The following procedure is required by the Windows Form Designer&lt;br /&gt;
    &amp;quot;It can be modified using the Windows Form Designer.  &lt;br /&gt;
    &amp;quot;Do not modify it using the code editor.&lt;br /&gt;
    Friend WithEvents PictureBox1 As System.Windows.Forms.PictureBox&lt;br /&gt;
    Friend WithEvents Label1 As System.Windows.Forms.Label&lt;br /&gt;
    Friend WithEvents HScrollBar1 As System.Windows.Forms.HScrollBar&lt;br /&gt;
    Friend WithEvents VScrollBar1 As System.Windows.Forms.VScrollBar&lt;br /&gt;
    Friend WithEvents Button1 As System.Windows.Forms.Button&lt;br /&gt;
    Friend WithEvents OpenFileDialog1 As System.Windows.Forms.OpenFileDialog&lt;br /&gt;
    &amp;lt;System.Diagnostics.DebuggerStepThrough()&amp;gt; Private Sub InitializeComponent()&lt;br /&gt;
        Me.PictureBox1 = New System.Windows.Forms.PictureBox&lt;br /&gt;
        Me.Label1 = New System.Windows.Forms.Label&lt;br /&gt;
        Me.HScrollBar1 = New System.Windows.Forms.HScrollBar&lt;br /&gt;
        Me.VScrollBar1 = New System.Windows.Forms.VScrollBar&lt;br /&gt;
        Me.Button1 = New System.Windows.Forms.Button&lt;br /&gt;
        Me.OpenFileDialog1 = New System.Windows.Forms.OpenFileDialog&lt;br /&gt;
        Me.SuspendLayout()&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;PictureBox1&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.PictureBox1.Location = New System.Drawing.Point(64, 72)&lt;br /&gt;
        Me.PictureBox1.Name = &amp;quot;PictureBox1&amp;quot;&lt;br /&gt;
        Me.PictureBox1.Size = New System.Drawing.Size(168, 144)&lt;br /&gt;
        Me.PictureBox1.TabIndex = 0&lt;br /&gt;
        Me.PictureBox1.TabStop = False&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;Label1&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.Label1.Font = New System.Drawing.Font(&amp;quot;Microsoft Sans Serif&amp;quot;, 24.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))&lt;br /&gt;
        Me.Label1.Location = New System.Drawing.Point(0, 0)&lt;br /&gt;
        Me.Label1.Name = &amp;quot;Label1&amp;quot;&lt;br /&gt;
        Me.Label1.Size = New System.Drawing.Size(264, 48)&lt;br /&gt;
        Me.Label1.TabIndex = 1&lt;br /&gt;
        Me.Label1.Text = &amp;quot;Handling Images&amp;quot;&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;HScrollBar1&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.HScrollBar1.Location = New System.Drawing.Point(64, 200)&lt;br /&gt;
        Me.HScrollBar1.Name = &amp;quot;HScrollBar1&amp;quot;&lt;br /&gt;
        Me.HScrollBar1.Size = New System.Drawing.Size(168, 16)&lt;br /&gt;
        Me.HScrollBar1.TabIndex = 2&lt;br /&gt;
        Me.HScrollBar1.Visible = False&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;VScrollBar1&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.VScrollBar1.Location = New System.Drawing.Point(216, 72)&lt;br /&gt;
        Me.VScrollBar1.Name = &amp;quot;VScrollBar1&amp;quot;&lt;br /&gt;
        Me.VScrollBar1.Size = New System.Drawing.Size(16, 128)&lt;br /&gt;
        Me.VScrollBar1.TabIndex = 3&lt;br /&gt;
        Me.VScrollBar1.Visible = False&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;Button1&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.Button1.Location = New System.Drawing.Point(112, 248)&lt;br /&gt;
        Me.Button1.Name = &amp;quot;Button1&amp;quot;&lt;br /&gt;
        Me.Button1.TabIndex = 4&lt;br /&gt;
        Me.Button1.Text = &amp;quot;Load Image&amp;quot;&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;Form1&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)&lt;br /&gt;
        Me.ClientSize = New System.Drawing.Size(292, 273)&lt;br /&gt;
        Me.Controls.Add(Me.Button1)&lt;br /&gt;
        Me.Controls.Add(Me.VScrollBar1)&lt;br /&gt;
        Me.Controls.Add(Me.HScrollBar1)&lt;br /&gt;
        Me.Controls.Add(Me.Label1)&lt;br /&gt;
        Me.Controls.Add(Me.PictureBox1)&lt;br /&gt;
        Me.Name = &amp;quot;Form1&amp;quot;&lt;br /&gt;
        Me.Text = &amp;quot;Form1&amp;quot;&lt;br /&gt;
        Me.ResumeLayout(False)&lt;br /&gt;
    End Sub&lt;br /&gt;
#End Region&lt;br /&gt;
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click&lt;br /&gt;
         PictureBox1.Image = Image.FromFile(&amp;quot;yourfile.jpg&amp;quot;)&lt;br /&gt;
         HScrollBar1.Maximum = PictureBox1.Image.Width - PictureBox1.Width + HScrollBar1.Height&lt;br /&gt;
         VScrollBar1.Maximum = PictureBox1.Image.Height - PictureBox1.Height + VScrollBar1.Width&lt;br /&gt;
         VScrollBar1.Visible = True&lt;br /&gt;
         HScrollBar1.Visible = True&lt;br /&gt;
         If PictureBox1.Height &amp;gt; PictureBox1.Image.Height Then&lt;br /&gt;
             VScrollBar1.Visible = False&lt;br /&gt;
         End If&lt;br /&gt;
         If PictureBox1.Width &amp;gt; PictureBox1.Image.Width Then&lt;br /&gt;
             HScrollBar1.Visible = False&lt;br /&gt;
         End If&lt;br /&gt;
    End Sub&lt;br /&gt;
    Private Sub HScrollBar1_Scroll(ByVal sender As System.Object, ByVal e As System.Windows.Forms.ScrollEventArgs) Handles HScrollBar1.Scroll&lt;br /&gt;
        Dim gphPictureBox As Graphics = PictureBox1.CreateGraphics()&lt;br /&gt;
        gphPictureBox.DrawImage(PictureBox1.Image, New Rectangle(0, 0, _&lt;br /&gt;
            PictureBox1.Width - HScrollBar1.Height, _&lt;br /&gt;
            PictureBox1.Height - VScrollBar1.Width), _&lt;br /&gt;
            New Rectangle(HScrollBar1.Value, VScrollBar1.Value, _&lt;br /&gt;
            PictureBox1.Width - HScrollBar1.Height, _&lt;br /&gt;
            PictureBox1.Height - VScrollBar1.Width), GraphicsUnit.Pixel)&lt;br /&gt;
    End Sub&lt;br /&gt;
    Private Sub VScrollBar1_Scroll(ByVal sender As System.Object, ByVal e As System.Windows.Forms.ScrollEventArgs) Handles VScrollBar1.Scroll&lt;br /&gt;
        Dim gphPictureBox As Graphics = PictureBox1.CreateGraphics()&lt;br /&gt;
        gphPictureBox.DrawImage(PictureBox1.Image, New Rectangle(0, 0, _&lt;br /&gt;
            PictureBox1.Width - HScrollBar1.Height, _&lt;br /&gt;
            PictureBox1.Height - VScrollBar1.Width), _&lt;br /&gt;
            New Rectangle(HScrollBar1.Value, VScrollBar1.Value, _&lt;br /&gt;
            PictureBox1.Width - HScrollBar1.Height, _&lt;br /&gt;
            PictureBox1.Height - VScrollBar1.Width), GraphicsUnit.Pixel)&lt;br /&gt;
    End Sub&lt;br /&gt;
End Class&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Value change event: Verical/Horizontal scroll bar==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;vbnet&amp;quot;&amp;gt;Imports System.Drawing&lt;br /&gt;
Imports System.Drawing.Drawing2D&lt;br /&gt;
Imports System.Windows.Forms&lt;br /&gt;
public class PictureMouseDownEvent&lt;br /&gt;
   public Shared Sub Main&lt;br /&gt;
        Application.Run(New Form1)&lt;br /&gt;
   End Sub&lt;br /&gt;
End class&lt;br /&gt;
Public Class Form1&lt;br /&gt;
    Inherits System.Windows.Forms.Form&lt;br /&gt;
#Region &amp;quot; Windows Form Designer generated code &amp;quot;&lt;br /&gt;
    Public Sub New()&lt;br /&gt;
        MyBase.New()&lt;br /&gt;
        &amp;quot;This call is required by the Windows Form Designer.&lt;br /&gt;
        InitializeComponent()&lt;br /&gt;
        &amp;quot;Add any initialization after the InitializeComponent() call&lt;br /&gt;
    End Sub&lt;br /&gt;
    &amp;quot;Form overrides dispose to clean up the component list.&lt;br /&gt;
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)&lt;br /&gt;
        If disposing Then&lt;br /&gt;
            If Not (components Is Nothing) Then&lt;br /&gt;
                components.Dispose()&lt;br /&gt;
            End If&lt;br /&gt;
        End If&lt;br /&gt;
        MyBase.Dispose(disposing)&lt;br /&gt;
    End Sub&lt;br /&gt;
    &amp;quot;Required by the Windows Form Designer&lt;br /&gt;
    Private components As System.ruponentModel.IContainer&lt;br /&gt;
    &amp;quot;NOTE: The following procedure is required by the Windows Form Designer&lt;br /&gt;
    &amp;quot;It can be modified using the Windows Form Designer.  &lt;br /&gt;
    &amp;quot;Do not modify it using the code editor.&lt;br /&gt;
    Friend WithEvents TextBox1 As System.Windows.Forms.TextBox&lt;br /&gt;
    Friend WithEvents HScrollBar1 As System.Windows.Forms.HScrollBar&lt;br /&gt;
    Friend WithEvents VScrollBar1 As System.Windows.Forms.VScrollBar&lt;br /&gt;
    Friend WithEvents TextBox2 As System.Windows.Forms.TextBox&lt;br /&gt;
    &amp;lt;System.Diagnostics.DebuggerStepThrough()&amp;gt; Private Sub InitializeComponent()&lt;br /&gt;
        Me.TextBox1 = New System.Windows.Forms.TextBox&lt;br /&gt;
        Me.HScrollBar1 = New System.Windows.Forms.HScrollBar&lt;br /&gt;
        Me.VScrollBar1 = New System.Windows.Forms.VScrollBar&lt;br /&gt;
        Me.TextBox2 = New System.Windows.Forms.TextBox&lt;br /&gt;
        Me.SuspendLayout()&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;TextBox1&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.TextBox1.Location = New System.Drawing.Point(24, 88)&lt;br /&gt;
        Me.TextBox1.Name = &amp;quot;TextBox1&amp;quot;&lt;br /&gt;
        Me.TextBox1.Size = New System.Drawing.Size(200, 20)&lt;br /&gt;
        Me.TextBox1.TabIndex = 1&lt;br /&gt;
        Me.TextBox1.Text = &amp;quot;&amp;quot;&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;HScrollBar1&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.HScrollBar1.Location = New System.Drawing.Point(24, 152)&lt;br /&gt;
        Me.HScrollBar1.Name = &amp;quot;HScrollBar1&amp;quot;&lt;br /&gt;
        Me.HScrollBar1.Size = New System.Drawing.Size(200, 16)&lt;br /&gt;
        Me.HScrollBar1.TabIndex = 2&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;VScrollBar1&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.VScrollBar1.Location = New System.Drawing.Point(240, 88)&lt;br /&gt;
        Me.VScrollBar1.Name = &amp;quot;VScrollBar1&amp;quot;&lt;br /&gt;
        Me.VScrollBar1.TabIndex = 3&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;TextBox2&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.TextBox2.Location = New System.Drawing.Point(24, 120)&lt;br /&gt;
        Me.TextBox2.Name = &amp;quot;TextBox2&amp;quot;&lt;br /&gt;
        Me.TextBox2.Size = New System.Drawing.Size(200, 20)&lt;br /&gt;
        Me.TextBox2.TabIndex = 4&lt;br /&gt;
        Me.TextBox2.Text = &amp;quot;&amp;quot;&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;Form1&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)&lt;br /&gt;
        Me.ClientSize = New System.Drawing.Size(292, 273)&lt;br /&gt;
        Me.Controls.Add(Me.TextBox2)&lt;br /&gt;
        Me.Controls.Add(Me.VScrollBar1)&lt;br /&gt;
        Me.Controls.Add(Me.HScrollBar1)&lt;br /&gt;
        Me.Controls.Add(Me.TextBox1)&lt;br /&gt;
        Me.Name = &amp;quot;Form1&amp;quot;&lt;br /&gt;
        Me.Text = &amp;quot;Form1&amp;quot;&lt;br /&gt;
        Me.ResumeLayout(False)&lt;br /&gt;
    End Sub&lt;br /&gt;
#End Region&lt;br /&gt;
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load&lt;br /&gt;
        HScrollBar1.Minimum = 0&lt;br /&gt;
        HScrollBar1.Maximum = 100&lt;br /&gt;
        HScrollBar1.LargeChange = 20&lt;br /&gt;
        HScrollBar1.SmallChange = 5&lt;br /&gt;
        HScrollBar1.Value = 25&lt;br /&gt;
        VScrollBar1.Minimum = 0&lt;br /&gt;
        VScrollBar1.Maximum = 100&lt;br /&gt;
        VScrollBar1.LargeChange = 20&lt;br /&gt;
        VScrollBar1.SmallChange = 5&lt;br /&gt;
        VScrollBar1.Value = 25&lt;br /&gt;
        TextBox1.Text = &amp;quot;Horizontal scroll value: &amp;quot; &amp;amp; HScrollBar1.Value&lt;br /&gt;
        TextBox2.Text = &amp;quot;Vertical scroll value: &amp;quot; &amp;amp; VScrollBar1.Value&lt;br /&gt;
    End Sub&lt;br /&gt;
    Private Sub VScrollBar1_Scroll(ByVal sender As System.Object, ByVal e As System.Windows.Forms.ScrollEventArgs) Handles VScrollBar1.Scroll&lt;br /&gt;
        TextBox1.Text = &amp;quot;Horizontal scroll value: &amp;quot; &amp;amp; HScrollBar1.Value&lt;br /&gt;
        TextBox2.Text = &amp;quot;Vertical scroll value: &amp;quot; &amp;amp; e.NewValue&lt;br /&gt;
    End Sub&lt;br /&gt;
    Private Sub HScrollBar1_Scroll(ByVal sender As System.Object, ByVal e As System.Windows.Forms.ScrollEventArgs) Handles HScrollBar1.Scroll&lt;br /&gt;
        TextBox1.Text = &amp;quot;Horizontal scroll value: &amp;quot; &amp;amp; e.NewValue&lt;br /&gt;
        TextBox2.Text = &amp;quot;Vertical scroll value: &amp;quot; &amp;amp; VScrollBar1.Value&lt;br /&gt;
    End Sub&lt;br /&gt;
End Class&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	</feed>