那个高手帮我分析下啊,vb计算器代码 那里有问题

来源:百度知道 编辑:UC知道 时间:2024/05/30 09:25:40
Option Explicit
Dim num1 As Double, num2 As Double
Dim sum As Double
Dim ope As Double

Private Sub clean_Click()
num1 = 0
num2 = 0
sum = 0
Text1.Text = " "
End Sub

Private Sub close_Click()
End
End Sub

Private Sub Form_Load()
num1 = 0
num2 = 0
sum = 0
End Sub

Private Sub num_Click(Index As Integer)
Select Case Index
Case 0
If Text1.Text = " " Then
Text1.Text = "0"
Else
Text1.Text = Text1.Text + "0"
End If
Case 1
If Text1.Text = " " Then
Text1.Text = "1"
Else
Text1.Text = Text1.Text + "1"
End If
Case 2
If Text1.Text = " " Then
Text1.Text = "2"
Else
Text1.Text = Text1.Text + "2"
End If
Case 3
If Text1.Text = " " Then

楼上说得 CDb1-->cdbl 这个问题应该是拼写错误吧
搂主你的代码是不是没列全呢?
你在数字和字母按钮殿下的时候应该会分别调用num_Click和oper_click事件,并把对应的数字传过来,不知道搂主是没搬上来还是没写?
还有,我用的是vb.net,字符串连接不许写成string1 & string2
不能使用 + 不清楚楼主的情况

楼主可以把问题的症状或者错误信息发上来,让大家看下

CDb1-->cdbl