Rabu, 15 November 2017

TUGAS 1

TAMPILAN TUGAS 1 PROGRAM 1 (Data Mahasiswa Tanpa Keypress)




Txtnpm = ""
Txtnama = ""
Txtalamat = ""
Txtnpm.SetFocus
End Sub

Private Sub Cmdkeluar_Click()
Unload Me
End Sub

Private Sub Cmdlagi_Click()
Txtnpm = ""
Txtnama = ""
Txtalamat = ""
Txtnpm.SetFocus
End Sub


TAMPILAN TUGAS 1 PROGRAM 2 (Data Mahasiswa Menggunakan Keypress)




Private Sub Cmdbatal_Click()
Txtnpm = ""
Txtnama = ""
Txtalamat = ""
Txtnpm.SetFocus
End Sub

Private Sub Cmdkeluar_Click()
Unload Me
End Sub

Private Sub Cmdlagi_Click()
Txtnpm = ""
Txtnama = ""
Txtalamat = ""
Txtnpm.SetFocus
End Sub


Private Sub Txtnama_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Txtalamat.SetFocus
End If
End Sub

Private Sub Txtnpm_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Txtnama.SetFocus
End If
End Sub


TAMPILAN TUGAS 1 PROGRAM 3 (Penjumlahan Tanpa Keypress)



Private Sub Cmdhitung_Click()
Txtjumlah = Val(Txtnilai1) + Val(Txtnilai2) + Val(Txtnilai3)
End Sub

Private Sub Cmdbatal_Click()
Txtnilai1 = ""
Txtnilai2 = ""
Txtnilai3 = ""
Txtjumlah = ""
Txtnilai1.SetFocus
End Sub

Private Sub Cmdkeluar_Click()
Unload Me
End Sub

Private Sub Cmdlagi_Click()
Txtnilai1 = ""
Txtnilai2 = ""
Txtnilai3 = ""
Txtjumlah = ""
Txtnilai1.SetFocus
End Sub


TAMPILAN TUGAS 1 PROGRAM 4 (Penjumlahan Menggunakan Keypress)


Private Sub Cmdhitung_Click()

Txtjumlah = Val(Txtnilai1) + Val(Txtnilai2) + Val(Txtnilai3)
End Sub

Private Sub Cmdbatal_Click()
Txtnilai1 = ""
Txtnilai2 = ""
Txtnilai3 = ""
Txtjumlah = ""
Txtnilai1.SetFocus
End Sub

Private Sub Cmdkeluar_Click()
Unload Me
End Sub

Private Sub Cmdlagi_Click()
Txtnilai1 = ""
Txtnilai2 = ""
Txtnilai3 = ""
Txtjumlah = ""
Txtnilai1.SetFocus
End Sub


Private Sub Form_Load()

End Sub

Private Sub Txtnilai1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Txtnilai2.SetFocus
End If
End Sub


Private Sub Txtnilai2_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Txtnilai3.SetFocus
End If
End Sub


Private Sub Txtnilai3_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Txtjumlah = Val(Txtnilai1) + Val(Txtnilai2) + Val(Txtnilai3)
End If
End Sub


TAMPILAN TUGAS 1 PROGRAM 5 (Kalkulator Tanpa Keypress)

Private Sub cmdbatal_click()
Txtinput1 = ""
Txtinput2 = ""
Txtinput3 = ""
Txtinput4 = ""
Txtinput5 = ""
Txtinput6 = ""
Txtinput7 = ""
Txtinput8 = ""
txthasil1 = ""
txthasil2 = ""
txthasil4 = ""
txthasil3 = ""
hasil1 = ""
Txtinput1.SetFocus
End Sub

Private Sub cmdlagi_Click()
Txtinput1 = ""
Txtinput2 = ""
Txtinput3 = ""
Txtinput4 = ""
Txtinput5 = ""
Txtinput6 = ""
Txtinput7 = ""
Txtinput8 = ""
txthasil1 = ""
txthasil2 = ""
txthasil4 = ""
txthasil3 = ""
hasil1 = ""
Txtinput1.SetFocus
End Sub

Private Sub cmdkeluar_click()
Unload Me
End Sub

Private Sub cmdhasil_Click()
txthasil1 = Val(Txtinput1) + (Txtinput2)
txthasil2 = Val(Txtinput3) / (Txtinput4)
txthasil3 = Val(Txtinput5) - (Txtinput6)
txthasil4 = Val(Txtinput7) * (Txtinput8)
hasil1 = Val(txthasil1) + Val(txthasil2) + Val(txthasil3) + Val(txthasil4)
End Sub



TAMPILAN TUGAS 1 PROGRAM 6 (Kalkulator Menggunakan Keypress)


Private Sub txtinput1_keypress(KeyAscii As Integer)
If KeyAscii = 13 Then
Txtinput2.SetFocus
End If
End Sub
 

Private Sub txtinput2_keypress(KeyAscii As Integer)
If KeyAscii = 13 Then
Txtinput3.SetFocus
End If
End Sub
 

Private Sub txtinput3_keypress(KeyAscii As Integer)
If KeyAscii = 13 Then
Txtinput4.SetFocus
End If
End Sub
 

Private Sub txtinput4_keypress(KeyAscii As Integer)
If KeyAscii = 13 Then
Txtinput5.SetFocus
End If
End Sub
 

Private Sub txtinput5_keypress(KeyAscii As Integer)
If KeyAscii = 13 Then
Txtinput6.SetFocus
End If
End Sub
 

Private Sub txtinput6_keypress(KeyAscii As Integer)
If KeyAscii = 13 Then
Txtinput7.SetFocus
End If
End Sub
 

Private Sub txtinput7_keypress(KeyAscii As Integer)
If KeyAscii = 13 Then
Txtinput8.SetFocus
End If
End Sub
 

Private Sub txtinput8_keypress(KeyAscii As Integer)
If KeyAscii = 13 Then
txthasil1 = Val(Txtinput1) + (Txtinput2)
txthasil2 = Val(Txtinput3) / (Txtinput4)
txthasil3 = Val(Txtinput5) - (Txtinput6)
txthasil4 = Val(Txtinput7) * (Txtinput8)
hasil1 = Val(txthasil1) + Val(txthasil2) + Val(txthasil3) + Val(txthasil4)
End If
End Sub

Bagikan

Jangan lewatkan

TUGAS 1
4/ 5
Oleh

Subscribe via email

Suka dengan artikel di atas? Tambahkan email Anda untuk berlangganan.