Perulangan Pada VB NET
Koding :
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim a As Integer
For a = 1 To 10
ListBox1.Items.Add(a)
Next a
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim z As Byte
z = 1
Do While z <= 10
ListBox2.Items.Add(z)
z = z + 1
Loop
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Dim i As Byte
i = 1
Do Until i = 10
ListBox3.Items.Add(i)
i = i + 1
Loop
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
Dim j As Byte
j = 1
While j <= 10
ListBox4.Items.Add(j)
j = j + 1
End While
End Sub
End Class