Design form perulangan pada program vb net
Pada
TextBox1 propesties yang dirubah yaitu Multiline : True, ScrollBar : Vertical
Berikut merupakan contoh perulangan pada program VB Net
Public Class Form1
Dim j As Byte
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)Handles MyBase.Load
For i = 1 To 10
ListBox1.Items.Add(i)
Next
For i = 10 To 1 Step -1
ListBox2.Items.Add(i)
Next
j = 1
While j <= 10
ComboBox1.Items.Add(j)
j += 1
End While
j = 10
Do Until j < 1
ListBox3.Items.Add(j & " BD")
j -= 2
Loop
j = 1
Do While j < 10
TextBox1.Text = TextBox1.Text & j & " BD" & vbCrLf
j += 2
Loop
End Sub
End Class
Penjelasan
j += 2 sama dengan perintah j = j + 2
Sumber : http://mesran.net/berita-585-perulangan-pada-program-vb-net.html
Berikut merupakan contoh perulangan pada program VB Net
Public Class Form1
Dim j As Byte
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)Handles MyBase.Load
For i = 1 To 10
ListBox1.Items.Add(i)
Next
For i = 10 To 1 Step -1
ListBox2.Items.Add(i)
Next
j = 1
While j <= 10
ComboBox1.Items.Add(j)
j += 1
End While
j = 10
Do Until j < 1
ListBox3.Items.Add(j & " BD")
j -= 2
Loop
j = 1
Do While j < 10
TextBox1.Text = TextBox1.Text & j & " BD" & vbCrLf
j += 2
Loop
End Sub
End Class
Penjelasan
j += 2 sama dengan perintah j = j + 2
Sumber : http://mesran.net/berita-585-perulangan-pada-program-vb-net.html
Tidak ada komentar