VB Praktikum_3

Slide1

Private Sub Command1_Click()
Text7.Text = Val((Text3.Text) + Val(Text4.Text) + Val(Text5.Text) + Val(Text6.Text)) / 4
End Sub

Private Sub Command2_Click()
Text1.SetFocus
Text1.Text = “”
Text2.Text = “”
Text3.Text = “”
Text4.Text = “”
Text5.Text = “”
Text6.Text = “”
Text7.Text = “”
End Sub

Private Sub Command3_Click()
Text1.SetFocus
Text1.Text = “”
Text2.Text = “”
Text3.Text = “”
Text4.Text = “”
Text5.Text = “”
Text6.Text = “”
Text7.Text = “”
End Sub

Private Sub Command4_Click()
Unload Me
End Sub

Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text2.SetFocus
End If
End Sub

Private Sub Text2_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text3.SetFocus
End If

End Sub

Private Sub Text3_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text4.SetFocus
End If

End Sub

Private Sub Text4_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text5.SetFocus
End If

End Sub

Private Sub Text5_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text6.SetFocus
End If

End Sub

Private Sub Text6_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text7.SetFocus
End If

End Sub

VB Praktikum_2

Slide1

Private Sub cmdbagi_Click()
Txthsl.Text = Val(Txtnl.Text) / Val(Txtna.Text)
End Sub

Private Sub Cmdkali_Click()
Txthsl.Text = Val(Txtnl.Text) * Val(Txtna.Text)
End Sub

Private Sub Cmdkurang_Click()
Txthsl.Text = Val(Txtnl.Text) – Val(Txtna.Text)
End Sub

Private Sub Cmdtambah_Click()
Txthsl.Text = Val(Txtnl.Text) + Val(Txtna.Text)
End Sub

Private Sub Command5_Click()
Txtnl.Text = “”
Txtna.Text = “”
Txthsl.Text = “”
Txtnl.SetFocus
End Sub

Private Sub Command6_Click()
Unload Me
End Sub

Private Sub Txtnl_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Txtna.SetFocus
End If
End Sub

Private Sub Txtna_Change()
If KeyAscii = 13 Then
Txthsl.SetFocus
End If
End Sub

vb praktikum_1

Slide1

Private Sub Cmdbatal_Click()
Txtnpm.SetFocus
Txtnpm.Text = “”
Txtnm.Text = “”
Txtal.Text = “”
Txtjur.Text = “”
End Sub

Private Sub Command1_Click()
Txtnpm.SetFocus
Txtnpm.Text = “”
Txtnm.Text = “”
Txtal.Text = “”
Txtjur.Text = “”
End Sub

Private Sub Command3_Click()
End
End Sub

Private Sub Txtal_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Txtjur.SetFocus
End If
End Sub

Private Sub Txtnm_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Txtal.SetFocus
End If
End Sub

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