9 Addition Subtraction Form in VB.NET

Code:

Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim a As Integer
        Dim b As Integer

        a = TextBox1.Text
        b = TextBox2.Text


        If (RadioButton1.Checked) Then
            MsgBox("Result: " & (a + b))
        Else
            MsgBox("Result: " & (a - b))
        End If

    End Sub

    Private Sub TextBox1_TextChanged(sender As Object, e As EventArgs) Handles TextBox1.TextChanged

    End Sub
End Class



Output:




Previous
Next Post »