Public Class Form1
Dim a, b
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
a = Val(TextBox1.Text)
b = Val(TextBox2.Text)
TextBox3.Text = a + b
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
a = Val(TextBox1.Text)
b = Val(TextBox2.Text)
TextBox3.Text = a - b
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
a = Val(TextBox1.Text)
b = Val(TextBox2.Text)
TextBox3.Text = a * b
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
a = Val(TextBox1.Text)
b = Val(TextBox2.Text)
TextBox3.Text = a / b
End Sub
End Class
沒有留言:
張貼留言