TUGAS 7
Memenuhi tugas dari pak nandang, berikut tugas saya
Pertama buat coding buat login dulu, berikut codingnya dan hasilnya.
(gambar 1)
Selain nama
= “Erni” dan pass =”aa” , maka akan keluar message box yang berbunyi “Password
Salah”
(gambar 2)
Setelah
login berhasil maka keluar tampilan seperti dibawah ini
(gambar 3)
Saya
menggunakan MENUSTRIP dan button
MenuStrip
berisi luas, keliling, keluar, help dan terdapat button cascade, horizontal dan
vertical.
(gambar 4)
(gambar
5)
Saat toolstrip
persegi panjang, segitiga, persegi dan lingkaran di klik keluar seperti
tampilan dibawah ini
(gambar 6)
(gambar 7)
Kemudian
apabila button cascade diklik tampilan berubah menjadi seperti ini
(gambar 8)
Ini tampilan
saat button horizontal yang di klik
(gambar 9)
Saat button
vertical yang diklik tidak terjadi perubahan karena memiliki 4 mdi child
(gambar 10)
Saat mdi
child 3 akan lebih terlihat saat button horizontal diklik, hasilnya akan
seperti dibawah ini
(gambar 11)
Dan ini
tampilan untuk tile vertikalnya
(gambar 12)
Coddingnya
dapat dilihat seperti dibawah ini
Public Class Kel_Lingkaran
Private Sub
Bthasil_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
Bthasil.Click
Dim r,
keliling As Integer
r = Txtjarijari.Text
keliling = 2 * 3.14 * r
Txtkel.Text = keliling
End Sub
Private Sub
Btkeluar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
Btkeluar.Click
Me.Close()
End Sub
End Class
Public Class Kel_Segitiga
Private Sub
Bthasil_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
Bthasil.Click
Dim a,
b, c, keliling As Integer
a = Txta.Text
b = Txtb.Text
c = Txtc.Text
keliling = a + b + c
Txtkeliling.Text = keliling
End Sub
Private Sub
Btkeluar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
Btkeluar.Click
Me.Close()
End Sub
End Class
Public Class Kel_Persegi
Private Sub
Bthasil_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
Bthasil.Click
Dim s,
keliling As Integer
s = Txtsisi.Text
keliling = 4 * s
Txtkel.Text = keliling
End Sub
Private Sub
Btkeluar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
Btkeluar.Click
Me.Close()
End Sub
End Class
Public Class Kel_PersegiPanjang
Private Sub
Bthasil_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
Bthasil.Click
Dim p,
l, keliling As Integer
p = Txtpanjang.Text
l = Txtlebar.Text
keliling = 2 * (p + l)
Txtkeliling.Text = keliling
End Sub
Private Sub
Btkeluar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
Btkeluar.Click
Me.Close()
End Sub
End Class
Public Class Lingkaran
Private Sub
Bthasil_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
Bthasil.Click
Dim r,
luas As Integer
r = Txtjarijari.Text
luas = 3.14 * r * r
Txtluas.Text = luas
End Sub
Private Sub
Btkeluar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
Btkeluar.Click
Me.Close()
End Sub
End Class
Public Class Segitiga
Private Sub
Bthasil_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
Bthasil.Click
Dim a,
t, luas As Integer
a = Txtalas.Text
t = Txttinggi.Text
luas = a * t / 2
Txtluas.Text = luas
End Sub
Private Sub
Btkeluar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
Btkeluar.Click
Me.Close()
End Sub
End Class
Public Class PersegiPanjang
Private Sub
Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
Bthasil.Click
Dim p,
l, luas As Integer
p = Txtpanjang.Text
l = Txtlebar.Text
luas = p * l
Txtluas.Text = luas
End Sub
Private Sub
Btkeluar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
Btkeluar.Click
Me.Close()
End Sub
End Class
Public Class Persegi
Private Sub
Bthasil_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
Bthasil.Click
Dim s,
luas As Integer
s = Txtsisi.Text
luas = s * s
Txtluas.Text = luas
End Sub
Private Sub
Btkeluar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
Btkeluar.Click
Me.Close()
End Sub
End Class
(gambar 13)
(gambar 14)
Sekian tugas
saya kali ini, kiranya kurang lengkap mohon maklum,
Tidak ada komentar:
Posting Komentar