24h購物| | PChome| 登入
2007-12-27 09:38:24| 人氣64| 回應0 | 上一篇 | 下一篇

計算機

推薦 0 收藏 0 轉貼0 訂閱站台

Public Class Form1

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Label2.Text = Val(TextBox1.Text) + Val(TextBox2.Text)
Label1.Text = "+"
Label3.Text = "="
End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Label2.Text = Val(TextBox1.Text) - Val(TextBox2.Text)
Label1.Text = "-"
Label3.Text = "="
End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Label2.Text = Val(TextBox1.Text) * Val(TextBox2.Text)
Label1.Text = "*"
Label3.Text = "="
End Sub

Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click

Label1.Text = "/"
Label3.Text = "="
If Val(TextBox2.Text) = 0 Then
Label2.Text = "錯誤"
Else
Label2.Text = Val(TextBox1.Text) / Val(TextBox2.Text)
Exit Sub
End If
End Sub


End Class

台長: ,,飛ㄦ*

您可能對以下文章有興趣

人氣(64) | 回應(0)| 推薦 (0)| 收藏 (0)| 轉寄
全站分類: 不分類

是 (若未登入"個人新聞台帳號"則看不到回覆唷!)
* 請輸入識別碼:
請輸入圖片中算式的結果(可能為0) 
(有*為必填)
TOP
詳全文