帮忙用vb制作一个简单的计算器,只需要有0--9 ,加减乘除等于,小数点,和清除退出按钮即可?

请把按钮命名过程写清楚!谢谢

第1个回答  2011-11-07
只要按代码要求建立控件就可以了
Private Sub Command1_Click(index As Integer)
Select Case index
Case 0
Text3.Text = Val(Text1.Text) + Text2.Text
Case 1
Text3.Text = Val(Text1.Text) - Text2.Text
Case 2
Text3.Text = Val(Text1.Text * Text2.Text)
Case 3
Text3.Text = Val(Text1.Text) / Text2.Text
Case 4
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Form1.Cls
Case 5
End
End Select
End Sub
Private Sub Command1_Click(index As Integer)
Select Case index
Case 0
Text3.Text = Val(Text1.Text) + Text2.Text
Case 1
Text3.Text = Val(Text1.Text) - Text2.Text
Case 2
Text3.Text = Val(Text1.Text * Text2.Text)
Case 3
Text3.Text = Val(Text1.Text) / Text2.Text
Case 4
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Form1.Cls
Case 5
End
End Select
End Sub
Private Sub Command1_Click(index As Integer)
Select Case index
Case 0
Text3.Text = Val(Text1.Text) + Text2.Text
Case 1
Text3.Text = Val(Text1.Text) - Text2.Text
Case 2
Text3.Text = Val(Text1.Text * Text2.Text)
Case 3
Text3.Text = Val(Text1.Text) / Text2.Text
Case 4
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Form1.Cls
Case 5
End
End Select
End Sub追问

似乎跟我说的不一样啊,我的只需要一个text

追答

按照如图所示的的建立控件就可以了,记住command是一个控件数组你自己看一下

第2个回答  2011-11-07
123
456 456
789
0#*

参考资料:手机

第3个回答  2011-11-07
楼主网上有好多源码啊 ,你随便搜一下就有一大堆啊,自己下一个吧追问

是啊 ,可是比较乱,在vb里运行不了,总会出现这样那样的问题……

相关了解……

你可能感兴趣的内容

本站内容来自于网友发表,不代表本站立场,仅表示其个人看法,不对其真实性、正确性、有效性作任何的担保
相关事宜请发邮件给我们
© 非常风气网