Wednesday, 11 May 2016

Calculator using VB

Calculator using VB


First create the above design of your calculator in the form designer and then copy the below code into the code window of the vb.

Code:


    Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
        TextBox3.Text = TextBox1.Text + TextBox2.Text
    End Sub
    Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles Button2.Click
        TextBox3.Text = TextBox1.Text - TextBox2.Text
    End Sub
    Private Sub Button3_Click(sender As System.Object, e As System.EventArgs) Handles Button3.Click
        TextBox3.Text = TextBox1.Text / TextBox2.Text
    End Sub
    Private Sub Button4_Click(sender As System.Object, e As System.EventArgs) Handles Button4.Click
        TextBox3.Text = TextBox1.Text * TextBox2.Text
    End Sub

No comments:

Post a Comment