1. Buka Aplikasi Visual Basic 6.0 Brada
2. Pilih Standard Exe
3. Pada jendela Form Buatlah Seperti ini
4. Pengaturan Property Setiap Object di dalamnya :
5. Buka Jendela code editor, dan ketikan coding di bawah ke dalam code editor
6. Penjelasan Code ProgramDim var1 As Single, var2 As Single
Dim hasil As Single
Private Sub Option1_Click()
var1 = Text1.Text
var2 = Text2.Text
hasil = var1 + var2
Label3.Caption = hasil
End Sub
Private Sub Option2_Click()
var1 = Text1.Text
var2 = Text2.Text
hasil = var1 - var2
Label3.Caption = hasil
End Sub
Private Sub Option3_Click()
var1 = Text1.Text
var2 = Text2.Text
hasil = var1 * var2
Label3.Caption = hasil
End Sub
Private Sub Option4_Click()
var1 = Text1.Text
var2 = Text2.Text
hasil = var1 / var2
Label3.Caption = hasil
End Sub
Private Sub Option5_Click()
var1 = Text1.Text
var2 = Text2.Text
hasil = var1 & var2
Label3.Caption = hasil
End Sub
Private Sub Option6_Click()
var1 = Text1.Text
var2 = Text2.Text
hasil = (var1 > var2)
‘Label3.Caption = hasil
Label3.Caption = Format(hasil, "True/False")
End Sub
Private Sub Option7_Click()
var1 = Text1.Text
var2 = Text2.Text
hasil = (var1 < var2)
Label3.Caption = Format(hasil, "True/False")
End Sub
Private Sub Option8_Click()
var1 = Text1.Text
var2 = Text2.Text
hasil = (var1 = var2)
Label3.Caption = Format(hasil, "True/False")
End Sub
Private Sub Option9_Click()
var1 = Text1.Text
var2 = Text2.Text
hasil = (var1 <> var2)
Label3.Caption = Format(hasil, "True/False")
End Sub
Private Sub Option10_Click()
var1 = Text1.Text
var2 = Text2.Text
hasil = (var1 >= var2)
Label3.Caption = Format(hasil, "True/False")
End Sub
Private Sub Option11_Click()
var1 = Text1.Text
var2 = Text2.Text
hasil = (var1 <= var2)
Label3.Caption = Format(hasil, "True/False")
End Sub
Private Sub Option12_Click()
var1 = IIf(Text1.Text = "True", -1, 0)
hasil = Not (var1)
Label3.Caption = Format(hasil, "True/False")
End Sub
Private Sub Option13_Click()
var1 = IIf(Text1.Text = "True", -1, 0)
var2 = IIf(Text2.Text = "True", -1, 0)
hasil = (var1 Or var2)
Label3.Caption = Format(hasil, "True/False")
End Sub
Private Sub Option14_Click()
var1 = IIf(Text1.Text = "True", -1, 0)
var2 = IIf(Text2.Text = "True", -1, 0)
hasil = (var1 And var2)
Label3.Caption = Format(hasil, "True/False")
End Sub
- Ouput Hasil Program di atas :
0 komentar:
Posting Komentar