Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Public Class Form1
- Private Sub btTambah_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btTambah.Click
- Dim b1, b2 As New Integer
- Dim h As New Double
- b1 = Val(txtBil1.Text)
- b2 = Val(txtBil2.Text)
- h = b1 + b2
- txtHasil.Text = h
- End Sub
- Private Sub btKurang_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btKurang.Click
- Dim b1, b2 As New Integer
- Dim h As New Double
- b1 = Val(txtBil1.Text)
- b2 = Val(txtBil2.Text)
- h = b1 - b2
- txtHasil.Text = h
- End Sub
- Private Sub btKali_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btKali.Click
- Dim b1, b2 As New Integer
- Dim h As New Double
- b1 = Val(txtBil1.Text)
- b2 = Val(txtBil2.Text)
- h = b1 * b2
- txtHasil.Text = h
- End Sub
- Private Sub btBagi_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btBagi.Click
- Dim b1, b2 As New Integer
- Dim h As New Double
- b1 = Val(txtBil1.Text)
- b2 = Val(txtBil2.Text)
- h = b1 / b2
- txtHasil.Text = h
- End Sub
- Private Sub btNew_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btNew.Click
- txtBil1.Clear()
- txtBil2.Clear()
- txtHasil.Clear()
- txtBil1.Focus()
- End Sub
- Private Sub btClose_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btClose.Click
- Me.Close()
- End Sub
- Private Sub txtBil1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtBil1.KeyPress
- If e.KeyChar = Chr(13) Then
- Me.txtBil2.Focus()
- End If
- End Sub
- Private Sub txtBil2_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtBil2.KeyPress
- If e.KeyChar = Chr(13) Then
- Me.btNew.Focus()
- End If
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment