Latihan Perhitungan Aritmatika



Coding nya :

Public Class Frlatihan3

    Private Sub btClose_Click(ByValsender As System.Object, ByVal e AsSystem.EventArgs) Handles btClose.Click
        Me.Close()
    End Sub

    Private Sub txtBil1_KeyPress(ByValsender As Object, ByVal e AsSystem.Windows.Forms.KeyPressEventArgs) HandlestxtBil1.KeyPress
        Ife.KeyChar = Chr(13) Then
            Me.txtBil2.Focus()
        End If
    End Sub

    Private Sub txtBil2_KeyPress(ByValsender As Object, ByVal e AsSystem.Windows.Forms.KeyPressEventArgs) HandlestxtBil2.KeyPress
        Ife.KeyChar = Chr(13) Then
            Me.btNew.Focus()
        End If
    End Sub

    Private Sub btNew_Click(ByValsender As System.Object, ByVal e AsSystem.EventArgs) Handles btNew.Click
        Me.txtBil1.Clear()
        Me.txtBil2.Clear()
        Me.txtHasil.Clear()
        Me.txtBil1.Focus()
    End Sub

    Private Sub Frlatihan3_Load(ByValsender As System.Object, ByVal e AsSystem.EventArgs) Handles MyBase.Load
        '---Mengisi proferti objek Form
        Me.Text = "Latihan Perhitungan Aritmatika"
    End Sub

    Private Sub btTambah_Click(ByValsender As System.Object, ByVal e AsSystem.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(ByValsender As System.Object, ByVal e AsSystem.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(ByValsender As System.Object, ByVal e AsSystem.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(ByValsender As System.Object, ByVal e AsSystem.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

End Class

Download di sini PDF

0 comments:

Post a Comment

 
MemeArt © 2024. All Rights Reserved. Powered by Blogger
Top