Kasus 1 Menggunakan For .... Next
Berikut Source Codenya :
Public Class kasus1
'nadiahtami 2017230007'
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
For i = 1 To 12
ListBox1.Items.Add(MonthName(i))
Next
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim pesan As String
pesan = MsgBox("Yakin Ingin Keluar??", vbYesNo, "Konfirmasi")
If pesan = vbYes Then
End
End If
End Sub
End Class
Berikut Source Codenya :
Public Class kasus2
'nadiahtami 2017230007'
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim pesan As String
pesan = MsgBox("Yakin Ingin Keluar??", vbYesNo, "Konfirmasi")
If pesan = vbYes Then
End
End If
End Sub
Private Sub kasus2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
ComboBox1.Text = "-Tanggal-"
ComboBox2.Text = "-Bulan-"
ComboBox3.Text = "-Tahun-"
For i = 1 To 31
ComboBox1.Items.Add(Str(i))
Next i
For i = 1 To 12
ComboBox2.Items.Add(MonthName(i))
Next i
For i = 1990 To Year(Now)
ComboBox3.Items.Add(Str(i))
Next i
End Sub
End Class
Berikut Source Codenya :
Public Class kasus3
'nadiahtami 2017230007'
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim angka As Integer
For angka = TextBox1.Text To TextBox2.Text
If angka Mod 2 = 0 Then
ListBox2.Items.Add(angka)
Else
ListBox1.Items.Add(angka)
End If
Next angka
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim pesan As String
pesan = MsgBox("Yakin Ingin Keluar??", vbYesNo, "Konfirmasi")
If pesan = vbYes Then
End
End If
End Sub
End Class
Terimakasih :)
Selamat Belajar :)
Komentar
Posting Komentar