| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 490 人关注过本帖
标题:计算器问题
只看楼主 加入收藏
z8520134679
Rank: 1
等 级:新手上路
帖 子:17
专家分:0
注 册:2007-6-6
收藏
 问题点数:0 回复次数:4 
计算器问题

Dim a As Double
Dim b As Double
Dim c As Double
Dim d As Double
Dim e As Double


Private Sub Command1_Click()
i = 1
If a = 0 Then
Text1.Text = i
a = i
b = i
Else
Text1.Text = b * 10 + i
a = b * 10 + i
b = b * 10 + i
End If
End Sub

Private Sub Command10_Click()
d = b
a = 0
b = 0
c = 1

End Sub

Private Sub Command11_Click()
d = b
a = 0
b = 0
c = 2
End Sub

Private Sub Command12_Click()
d = b
a = 0
b = 0
c = 3
End Sub

Private Sub Command13_Click()
d = b
a = 0
b = 0
c = 4
End Sub

Private Sub Command14_Click()
Select Case c
Case "1"
Text1.Text = b + d
Case "2"
Text1.Text = d - b
Case "3"
Text1.Text = b * d
Case "4"
Text1.Text = d / b
End Select

End Sub


Private Sub Command15_Click()
i = 0
If a = 0 Then
Text1.Text = i
a = i
b = i
Else
Text1.Text = b * 10
a = b * 10
b = b * 10
End If
End Sub

Private Sub Command2_Click()
i = 2
If a = 0 Then
Text1.Text = i
a = i
b = i
Else
Text1.Text = b * 10 + i
a = b * 10 + i
b = b * 10 + i
End If
End Sub

Private Sub Command3_Click()
i = 3
If a = 0 Then
Text1.Text = i
a = i
b = i
Else
Text1.Text = b * 10 + i
a = b * 10 + i
b = b * 10 + i
End If
End Sub

Private Sub Command4_Click()
i = 4
If a = 0 Then
Text1.Text = i
a = i
b = i
Else
Text1.Text = b * 10 + i
a = b * 10 + i
b = b * 10 + i
End If
End Sub

Private Sub Command5_Click()
i = 5
If a = 0 Then
Text1.Text = i
a = i
b = i
Else
Text1.Text = b * 10 + i
a = b * 10 + i
b = b * 10 + i
End If
End Sub

Private Sub Command6_Click()
i = 6
If a = 0 Then
Text1.Text = i
a = i
b = i
Else
Text1.Text = b * 10 + i
a = b * 10 + i
b = b * 10 + i
End If
End Sub

Private Sub Command7_Click()
i = 7
If a = 0 Then
Text1.Text = i
a = i
b = i
Else
Text1.Text = b * 10 + i
a = b * 10 + i
b = b * 10 + i
End If
End Sub

Private Sub Command8_Click()
i = 8
If a = 0 Then
Text1.Text = i
a = i
b = i
Else
Text1.Text = b * 10 + i
a = b * 10 + i
b = b * 10 + i
End If
End Sub

Private Sub Command9_Click()
i = 9
If a = 0 Then
Text1.Text = i
a = i
b = i
Else
Text1.Text = b * 10 + i
a = b * 10 + i
b = b * 10 + i
End If
End Sub



问题是在按了=于之后得到的答案不能在进行第2次加
如1+2=3
+1=3
这个只在第个上加起的那个帮下我

搜索更多相关主题的帖子: 计算器 Sub Double Dim Private 
2007-06-07 08:45
黑暗公爵
Rank: 1
等 级:新手上路
威 望:1
帖 子:46
专家分:0
注 册:2007-5-31
收藏
得分:0 

能给下界面么?好理解一些


头发遮住眼睛,身心坠入冥冥,世间万千烦扰,我自成竹在胸。
2007-06-07 09:16
z8520134679
Rank: 1
等 级:新手上路
帖 子:17
专家分:0
注 册:2007-6-6
收藏
得分:0 
OK
2007-06-07 09:18
z8520134679
Rank: 1
等 级:新手上路
帖 子:17
专家分:0
注 册:2007-6-6
收藏
得分:0 
图片附件: 游客没有浏览图片的权限,请 登录注册
这个是加完=于得到的
图片附件: 游客没有浏览图片的权限,请 登录注册
这个是在加
图片附件: 游客没有浏览图片的权限,请 登录注册
这个是最后得到的
2007-06-07 09:48
z8520134679
Rank: 1
等 级:新手上路
帖 子:17
专家分:0
注 册:2007-6-6
收藏
得分:0 
图片附件: 游客没有浏览图片的权限,请 登录注册
+
图片附件: 游客没有浏览图片的权限,请 登录注册

2007-06-07 09:51
快速回复:计算器问题
数据加载中...
 
   



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

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