Buat Form y seperti
ini yaa…
Selanjutnya ikuti
Langkah Berikut :
1. Bikin Frame-1 kasih
nama (caption-) Kalkulator Sederhana
Kemudian bikin label caption1_Nilai Ke Satu
Caption2_Nilai Kedua
Caption3_Hasil
2. Bikin Frame-2 kasih
nama (caption-) Operasi Aritmatika
Terus bikin deh Operasi Matematika nya,untuk yang ke-
3. Sama yang ke-4 caranya
sama tapi kalian rubah caption sama operasi aritmatika y saja
Nih dia rumus y,,,
Private Sub
cmdbagi_Click()
txtC.Text = Val(TxtA.Text) /
Val(TxtB.Text)
End Sub
Private Sub cmdkali_Click()
txtC.Text = Val(TxtA.Text) *
Val(TxtB.Text)
End Sub
Private Sub cmdkd_Click()
txtC.Text = Val(TxtA.Text) <= Val(TxtB.Text)
End Sub
Private Sub cmdkurang_Click()
txtC.Text = Val(TxtA.Text) < Val(TxtB.Text)
End Sub
Private Sub cmdld_Click()
txtC.Text = Val(TxtA.Text) >= Val(TxtB.Text)
End Sub
Private Sub cmdlebih_Click()
txtC.Text = Val(TxtA.Text) > Val(TxtB.Text)
End Sub
Private Sub cmdmin_Click()
txtC.Text = Val(TxtA.Text) - Val(TxtB.Text)
End Sub
Private Sub cmdmod_Click()
txtC.Text = Val(TxtA.Text) Mod Val(TxtB.Text)
End Sub
Private Sub cmdsama_Click()
txtC.Text = Val(TxtA.Text) = Val(TxtB.Text)
End Sub
Private Sub cmdstring_Click()
txtC.Text = (TxtA.Text) + (TxtB.Text)
End Sub
Private Sub Cmdtambah_Click()
txtC.Text = Val(TxtA.Text) + Val(TxtB.Text)
End Sub
Private Sub cmdts_Click()
txtC.Text = Val(TxtA.Text) <> Val(TxtB.Text)
End Sub
Private Sub txtand_Click()
txtD.Text = Val(TxtA.Text) <= Val(TxtB.Text) And
Val(TxtB.Text) < Val(txtC.Text)
End Sub
Private Sub txtNot_Click()
txtD.Text = Not Val(TxtA.Text) < Val(TxtB.Text)
End Sub
Private Sub Txtor_Click()
txtD.Text = Val(TxtA.Text) > Val(TxtB.Text) Or
Val(TxtB.Text) = Val(txtC.Text)
End Sub
Seperti ini hasilnya,,,
0 komentar:
Posting Komentar