Latihan 1
1. Buat
Project baru
2 buat
interface seperti ini
Public Class Form1
Private Sub btn_show_Click(sender As Object, e As EventArgs) Handles btn_show.Click
lbl_ucap.Text = "Hello"
+ txt_nama.Text
End Sub
End Class
Latihan 2
1. Buat
form Baru
2. Buat
Interface seperti ini
3. Masukan
koding dibawah ini
Public Class Form2
Private Sub btn_show_Click(sender As Object, e As EventArgs) Handles btn_show.Click
lbl_ucapan.Text = txt_dayweek.Text & " , " & txt_month.Text & ", " & txt_daymonth.Text
& ", " & txt_year.Text
End Sub
Private Sub btn_clear_Click(sender As Object, e As EventArgs) Handles btn_clear.Click
txt_daymonth.Clear()
txt_dayweek.Clear()
txt_month.Clear()
txt_year.Clear()
lbl_ucapan.Text = String.Empty
txt_dayweek.Focus()
End Sub
Private Sub btn_exit_Click(sender As Object, e As EventArgs) Handles btn_exit.Click
Me.Close()
End Sub
End Class
Latihan 3
1. buat
form baru
2. buat
interface seperti ini
3. Masukan
koding dibawah ini
Public Class Form3
Private Sub btn_show_Click(sender As Object, e As EventArgs) Handles btn_show.Click
lbl_full.Text = txt_awal.Text & " " & txt_akhir.Text
End Sub
Private Sub btn_clear_Click(sender As Object, e As EventArgs) Handles btn_clear.Click
txt_akhir.Clear()
txt_awal.Clear()
lbl_full.Text = String.Empty
End Sub
Private Sub btn_exit_Click(sender As Object, e As EventArgs) Handles btn_exit.Click
Me.Close()
End Sub
End Class
Latihan 4
1. buat
form baru
2. buat
interface seperti ini
3. Masukan
koding dibawah ini
Public Class Form4
Private Sub TextBox1_TextChanged(sender As Object, e As EventArgs) Handles txt_satu.TextChanged
End Sub
Private Sub btn_tambah_Click(sender As Object, e As EventArgs) Handles btn_tambah.Click
txt_hasil.Text = CDec(txt_satu.Text) + CDec(txt_dua.Text)
End Sub
Private Sub btn_kurang_Click(sender As Object, e As EventArgs) Handles btn_kurang.Click
txt_hasil.Text = CDec(txt_satu.Text) - CDec(txt_dua.Text)
End Sub
Private Sub btn_bagi_Click(sender As Object, e As EventArgs) Handles btn_bagi.Click
txt_hasil.Text = CDec(txt_satu.Text) / CDec(txt_dua.Text)
End Sub
Private Sub btn_kali_Click(sender As Object, e As EventArgs) Handles btn_kali.Click
txt_hasil.Text = CDec(txt_satu.Text) * CDec(txt_dua.Text)
End Sub
Private Sub btn_bagiint_Click(sender As Object, e As EventArgs) Handles btn_bagiint.Click
txt_hasil.Text = CDec(txt_satu.Text) \ CDec(txt_dua.Text)
End Sub
Private Sub btn_pangkat_Click(sender As Object, e As EventArgs) Handles btn_pangkat.Click
txt_hasil.Text = CDec(txt_satu.Text) ^ CDec(txt_dua.Text)
End Sub
Private Sub btn_mod_Click(sender As Object, e As EventArgs) Handles btn_mod.Click
txt_hasil.Text = CDec(txt_satu.Text) Mod CDec(txt_dua.Text)
End Sub
Private Sub btn_clear_Click(sender As Object, e As EventArgs) Handles btn_clear.Click
txt_dua.Clear()
txt_satu.Clear()
txt_hasil.Clear()
txt_satu.Focus()
End Sub
Private Sub btn_close_Click(sender As Object, e As EventArgs) Handles btn_close.Click
Me.Close()
End Sub
End Class