Cara Membuat Kalkulator dengan Visual Basic 6.0
Objek
|
Properties
|
Value
|
Form
|
Name
|
frmkalkulator
|
Captoin
|
Kalkulator
|
|
Command1
|
Name
|
cmdbersih
|
Caption
|
BERSIH
|
|
Command2
|
Name
|
cmdkeluar
|
Caption
|
KELUAR
|
|
Text1
|
Name
|
Txtangka1
|
Text
|
(kosongkan)
|
|
Text2
|
Name
|
Txtangka2
|
Text
|
(Kosongkan)
|
|
Text3
|
Name
|
txthasil
|
Text
|
(kosongkan)
|
|
Option1
|
Name
|
optT
|
Caption
|
+
|
|
Option2
|
Name
|
optKL
|
Caption
|
*
|
|
Option3
|
Name
|
optBLK
|
Caption
|
\
|
|
Option4
|
Name
|
optdan
|
Caption
|
&&
|
|
Option5
|
Name
|
OptK
|
Caption
|
-
|
|
Option6
|
Name
|
OptB
|
Caption
|
/
|
|
Option7
|
Name
|
Optpng
|
Caption
|
^
|
|
Option8
|
Name
|
optmod
|
Caption
|
Mod
|
|
Frame1
|
Caption
|
Operator
|
Shape1
|
()
|
()
|
Ini Souce Code Monggo di copy :
Private Sub ckbersih_Click()
'Mengosongkan isi TextBox
txtangka1.Text = ""
txtangka2.Text = ""
txthasil.Text = ""
End Sub
Private Sub cmdBersih_Click()
'Mengosongkan isi TextBox
txtangka1.Text = ""
txtangka2.Text = ""
txthasil.Text = ""
End Sub
Private Sub Command1_Click()
'mengakhiri program
End
End Sub
Private Sub cmdkeluar_Click()
End
End Sub
Private Sub optB_Click()
txthasil.Text = Val(txtangka1.Text) / Val(txtangka2.Text)
End Sub
Private Sub optBLK_Click()
txthasil.Text = Val(txtangka1.Text) \ Val(txtangka2.Text)
End Sub
Private Sub optdan_Click()
txthasil.Text = Val(txtangka1.Text) & Val(txtangka2.Text)
End Sub
Private Sub optK_Click()
txthasil.Text = Val(txtangka1.Text) - Val(txtangka2.Text)
End Sub
Private Sub optKL_Click()
txthasil.Text = Val(txtangka1.Text) * Val(txtangka2.Text)
End Sub
Private Sub optmod_Click()
txthasil.Text = Val(txtangka1.Text) Mod Val(txtangka2.Text)
End Sub
Private Sub optpng_Click()
txthasil.Text = Val(txtangka1.Text) ^ Val(txtangka2.Text)
End Sub
Private Sub optT_Click()
txthasil.Text = Val(txtangka1.Text) + Val(txtangka2.Text)
End Sub
Atau Donwload filenya : Disini
1 Comments
mantab
ReplyDelete