Modul IX
1. Buat rancangan antar muka seperti berikut.
2. Duble klik CMD Proses3. Ketikkan Program berikut :
Private Sub Command1_Click()
Dim nama As String
Dim TB, BB, BI, B As Single
nama = Text1.Text
TB = Val(Text2.Text)
BB = Val(Text3.Text)
BI = (TB - 110) * 1.1
If (BB > (1.1 * BI)) Then
Text4.Text = "Hallo " + nama + " Anda GEMUK juga yah..."
Else
If (BB < (0.9 * BI)) Then Text4.Text = "Hallo " + nama + " Anda KURUS Banget..."
Else
Text4.Text = "Hallo " + nama + " Anda IDEAL juga ternyata..."
End If
End If
End Sub
Private Sub Command2_Click()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
End Sub
Private Sub Command3_Click()
MsgBox "apa ANDA yakin ingin keluar.?", vbOKCancel + vbQuestion, "KONFIRMASI"
End
End Sub
Private Sub Form_Load()
End Sub
4. Hasilnya Seperti Berikut

0 komentar:
Posting Komentar