2009年3月27日 星期五

28

Public Class Form1

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim Tot As Integer
Tot = Val(TextBox1.Text) + (TextBox2.Text)
TextBox3.Text = Tot

End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim Tot As Integer
Tot = Val(TextBox1.Text) - (TextBox2.Text)
TextBox3.Text = Tot
End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Dim Tot As Integer
Tot = Val(TextBox1.Text) * (TextBox2.Text)
TextBox3.Text = Tot
End Sub

Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
Dim Tot As String
Tot = Val(TextBox1.Text) / (TextBox2.Text)
TextBox3.Text = Tot
MsgBox(TextBox1.Text & "/" & TextBox2.Text & "=" & Tot)
End Sub