VB.NET

Hscroll & Vscroll

2014.01.10

* Public Class Form1

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
HScrollBar1.Minimum = 20
HScrollBar1.Maximum = 200
VScrollBar1.Minimum = 30
VScrollBar1.Maximum = 200
Label1.Text = "(" & VScrollBar1.Value & "," & HScrollBar1.Value & ")"
Label1.Location = New Point(HScrollBar1.Value, VScrollBar1.Value)

End Sub

Private Sub HScrollBar1_Scroll(ByVal sender As System.Object, ByVal e As System.Windows.Forms.ScrollEventArgs) Handles HScrollBar1.Scroll
Label1.Text = "(" & VScrollBar1.Value & "," & HScrollBar1.Value & ")"
Label1.Location = New Point(HScrollBar1.Value, VScrollBar1.Value)
End Sub

Private Sub VScrollBar1_Scroll(ByVal sender As System.Object, ByVal e As System.Windows.Forms.ScrollEventArgs) Handles VScrollBar1.Scroll
Label1.Text = "(" & VScrollBar1.Value & "," & HScrollBar1.Value & ")"
Label1.Location = New Point(HScrollBar1.Value, VScrollBar1.Value)
End Sub
End Class 

 

 

* HScroll, VScroll 콘트롤을 폼에 사용하여 이동에 따른 변화된 값을 이용할수 있다

* 소스파일 : 20140111-Hscroll_Vscroll.zip