tugas 2

nmer4nmer2nmer1

Private Sub Cmdbatal_Click()

Textkb.SetFocus

Textkb = ” ”

Textnb = ” ”

Textnpn = ” ”

Textnp = ” ”

Texttt = ” ”

End Sub

 

Private Sub Cmdkeluar_Click()

End

End Sub

 

Private Sub Cmdlagi_Click()

Textkb.SetFocus

Textkb = ” ”

Textnb = ” ”

Textnpn = ” ”

Textnp = ” ”

Texttt = ” ”

End Sub

 

 

Private Sub Textkb_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

Textnb.SetFocus

End If

End Sub

Private Sub Textnb_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

Textnpn.SetFocus

End If

End Sub

 

Private Sub Textnp_KeyPress(KeyAscii As Integer)

 

If KeyAscii = 13 Then

Texttt.SetFocus

End If

End Sub

 

Private Sub Textnpn_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

Textnp.SetFocus

End If

End Sub

rumus 2-3

 

Private Sub Cmdbh_Click()

bil1.SetFocus

bil1.Text = “”

bil2.Text = “”

bil3.Text = “”

 

End Sub

 

Private Sub Cmdht_Click()

Dim A, B, C As Single

A = bil1.Text

B = bil2.Text

C = A * B

bil3.Text = C

 

End Sub

 

Private Sub Cmdkr_Click()

Unload Me

End Sub

 

Private Sub bil1_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

bil2.SetFocus

End If

 

End Sub

 

 

Private Sub bil2_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

Dim A, B, C As Single

A = bil1.Text

B = bil2.Text

C = A * B

bil3.Text = C

End If

 

End Sub

rumus program 6-7

Private Sub Cmd1_Click()

Dim A, B, C As Double

txtB.Text = Val(txtA.Text) * 0.1

txtC.Text = Val(txtA.Text) – Val(txtB.Text)

End Sub

 

Private Sub Cmd2_Click()

txtA.Text = “”

txtB.Text = “”

txtC.Text = “”

End Sub

 

Private Sub Cmd3_Click()

End

End Sub