Subscribe:

Daftar Isi

Senin, 26 Maret 2012

Kalkulator Sederhana With VB 6.0

Cara pembuatan kalkultor Sederhana
1.Bukalah VB
2.Pilih Standart
3.Buat 2 Label ,2text ,5Command
4.Biarkan label 1 dan tetap kosong ,(hapus caption pada 2 label tersebut) dan beri caption X, : , - ,=,<= pada command
5.
A.klik 2 kali command yang telah diberi caption X
   dan isikan kode berikut dibawah kode tsb:
Label1.caption="X"
End Sub
B.klik 2 kali command yangdiberi caption ":"
   dan isikan kode berikut dibawah kode tsb:
Label1.caption=":"
End Sub

C.klik 2 kali command yangdiberi caption "-"
   dan isikan kode berikut dibawah kode tsb:
Label1.caption="-"
End Sub
D.Klik 2 kali command yang diberi caption "="
    dan isikan kode berikut dibawah kode tsb:
If Label1.caption ="X" then
Label2.caption=Text1.text*Text2.text
End If
If Label1.caption =":" then
Label2.caption =Text1.text/Text2.text
End If
If Label1.caption ="-" then
Label2.caption =Text1.text-Text2.text
End If
If Text1.Text="" Then
Label2.Caption="Masukkan nomor"
End If
If Text2.Text="" Then
Label2.Caption="Masukkan nomor"
End If
End Sub

E.Klik 2 kali pada command yang diberi caption "<="
   Dan isikan kode berikut dibawah kode tsb :
Text1.text=""
Text2.text=""
Label1.Caption=""
6. Silahkan Dicoba kalkulator buatan mu!!!! 

0 komentar:

Posting Komentar


Welcome To

Mustofa's blogger