Public Class Form1
Private iList As New List(Of Double)
Private zList As New List(Of Decimal)
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim a, b, c, j, z As Decimal
a = -5
b = 5
c = 0.000001
j = 5
iList.Clear()
zList.Clear()
For i = a To b Step c
z = Math.Sqrt(j ^ 2 + i ^ 2)
iList.Add(i)
zList.Add(z)
Next
VScrollBar1.Maximum = zList.Count
End Sub
Private Sub VScrollBar1_Scroll(ByVal sender As System.Object, ByVal e As System.Windows.Forms.ScrollEventArgs) Handles VScrollBar1.Scroll
Dim x As New System.Text.StringBuilder
For k As Integer = VScrollBar1.Value To VScrollBar1.Value + 100
If k > zList.Count - 100 Then
Exit For
End If
x.AppendLine("X=" & Format(iList(k), "0.00000") & "," & "Z=" & Format(zList(k), "0.00000"))
Next
TextBox1.Text = x.ToString()
End Sub
End Class