Sabtu, 22 Maret 2014

Mencari Luas Segitiga


Private Sub CboAlas_Change()
LblAlas.Caption = CboAlas
End Sub

Private Sub CboTinggi_change()
LblTinggi.Caption = CboTinggi
End Sub

Private Sub CmdHapus_Click()
CboAlas = ""
CboTinggi = ""
TxtHasil = ""
LblAlas.Caption = "Isi Alas"
LblTinggi.Caption = "Isi Tinggi"
CboAlas.SetFocus
End Sub

Private Sub CmdHitung_Click()
If CboAlas = "" Or CboTinggi = "" Then
MsgBox ("Isi Nilai Alas dan Tinggi")
Else
Alas = CboAlas
Tinggi = CboTinggi
Hasil = (Alas * Tinggi) / 2
TxtHasil = Hasil
End If
End Sub

Private Sub CmdKeluar_Click()
DoCmd.Save
DoCmd.Close
End Sub

Private Sub Form_LOad()
Dim i As Integer
CboAlas = ""
CboTinggi = ""
TxtHasil = ""
For i = 1 To 20
CboAlas.AddItem i
CboTinggi.AddItem i
Next i
End Sub

Tidak ada komentar:

Posting Komentar