标题:找个人,帮我看下错在那里?新手上路
取消只看楼主
zyal
Rank: 1
等 级:新手上路
帖 子:17
专家分:0
注 册:2008-6-23
 问题点数:0 回复次数:1 
找个人,帮我看下错在那里?新手上路
我编写的一个计算器。。。
下面是我全部的响应代码

Private Sub Label1_Click()

End Sub

Private Sub AddOptin_Click()
SymbelLabel.Caption = "+"
OutputText.Text = ""
End Sub

Private Sub DivideOption_Click()
SymbelLabel.Caption = "/"
OutputText.Text = ""
End Sub

Private Sub MisnusOption_Click()
SymbelLabel.Caption = "-"
OutputText.Text = ""
End Sub

Private Sub MultiOption_Click()
SymbelLabel.Caption = "*"
OutputText.Text = ""
End Sub

Private Sub RunCommand_Click()
Dim Number1, Number2, Result As Single

Number1 = Val(InputText1.Text)
Number2 = Val(InputText2.Text)

If AddOption.Value = True Then
Result = Number1 + Number2
End If
If Minusption.Value = True Then
Result = Number1 - Number2
End If
If MultiOption.Value = True Then
Result = Number1 * Number2
End If
If DiviOption.Value = True Then
Result = Number1 / Number2
End If
End Sub

但是运行不了。。。我点调试,它说

If AddOption.Value = True Then
Result = Number1 + Number2
End If
If Minusption.Value = True Then
Result = Number1 - Number2
End If
If MultiOption.Value = True Then
Result = Number1 * Number2
End If
If DiviOption.Value = True Then
Result = Number1 / Number2
End If
End Sub
错了。。。。麻烦你们帮我看下
搜索更多相关主题的帖子: Sub Click 计算器 Caption 
2008-06-23 23:46
zyal
Rank: 1
等 级:新手上路
帖 子:17
专家分:0
注 册:2008-6-23
得分:0 
系统说我这里错了
If AddOption.Value = True Then
Result = Number1 + Number2
End If
If Minusption.Value = True Then
Result = Number1 - Number2
End If
If MultiOption.Value = True Then
Result = Number1 * Number2
End If
If DiviOption.Value = True Then
Result = Number1 / Number2
End If
End Sub
2008-06-24 12:39



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-220802-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.163591 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved