怎么用VB.NET编写计算器
怎么用VB.NET编写计算器好心人教下啊!!跪谢
怎么用VB.NET编写计算器好心人教下啊!!跪谢
答案:Public Class Form1
Private Sub tijiao_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tijiao.Click
Dim a, b, c As String
a = TextBox1.Text
b = TextBox2.Text
If aa(a, b) Then
End If
If Me.jia.Checked Then
MessageBox.Show("结果等于" & Val(a) + Val(b), "提示")
End If
If Me.jian.Checked Then
MessageBox.Show("结果等于" & Val(a) - Val(b), "提示")
End If
If Me.cheng.Checked Then
MessageBox.Show("结果等于" & Val(a) * Val(b), "提示")
End If
If Me.chu.Checked Then
MessageBox.Show("结果等于" & Val(a) / Val(b), "提示")
End If
End Sub
Private Function aa(ByVal bb As String, ByVal cc As String) As Boolean
If bb = "" Then
MessageBox.Show("请输入", " 提示")
aa = False
ElseIf Not IsNumeric(cc) Then
MessageBox.Show("请输入数字", "警告")
aa = False
Else
aa = True
End If
End Function
End Class什么样的,是很多按钮的嘛?