今天做了 簡易型計算機程式

需要 textbox*3 button*4 label*1

程式碼如下

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
txtOutput.text = val (textbox1.text) +val (textbox2.text)
end sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
txtOutput.text = val (textbox1.text) -val (textbox2.text)
end sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
txtOutput.text = val (textbox1.text) *val (textbox2.text)
end sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
txtOutput.text = val (textbox1.text) /val (textbox2.text)
end sub

其他可自行更改 與修正

完成後 如下圖

創作者介紹

↖Ι n V a D e R ╮

ip612256374 發表在 痞客邦 留言(0) 人氣()