Dim a, b, c
Private Sub cheng_Click()
fh.Caption = "×"
shu1.Text = ""
shu2.Text = ""
shu3.Text = ""
End Sub
Private Sub chu_Click()
fh.Caption = "÷"
shu1.Text = ""
shu2.Text = ""
shu3.Text = ""
End Sub
Private Sub chuti_Click()
Randomize
If jia.Value = True Then
a = Int(Rnd * 10) + 1
b = Int(Rnd * 10) + 1
c = a + b
End If
If jian.Value = True Then
c = Int(Rnd * 10) + 1
b = Int(Rnd * 10) + 1
a = c + b
End If
If cheng.Value = True Then
a = Int(Rnd * 10) + 1
b = Int(Rnd * 10) + 1
c = a * b
End If
If chu.Value = True Then
c = Int(Rnd * 10) + 1
b = Int(Rnd * 10) + 1
a = c * b
End If
shu1.Text = a
shu2.Text = b
shu3.Text = ""
chuti.Enabled = False
jiaojuan.Enabled = True
End Sub
Private Sub jia_Click()
fh.Caption = "+"
shu1.Text = ""
shu2.Text = ""
shu3.Text = ""
End Sub
Private Sub jian_Click()
fh.Caption = "-"
shu1.Text = ""
shu2.Text = ""
shu3.Text = ""
End Sub
Private Sub jiaojuan_Click()
If c = Val(shu3.Text) Then
shu1.Text = ""
shu2.Text = ""
shu3.Text = ""
chuti.Enabled = True
jiaojuan.Enabled = False
MsgBox "对了!"
Else
MsgBox "错了!"
End If
End Sub
11.17VBA四则运算
笨巧果 发表于: 2010-11-17 21:58 来源: 扑奔PPT网
大家对 11.17VBA四则运算 的评论
最新PPT模板
最新贴子
PPT热贴
VB四则运算.jpg
23.3 KB, 下载次数: 65)
[ 本帖最后由 心的 于 2010-11-17 22:33 编辑 ]
20.2 KB, 下载次数: 45)
20.2 KB, 下载次数: 43)
收获很大,谢谢果果老师!
[ 本帖最后由 嫦娥奔月 于 2010-11-17 23:01 编辑 ]
幻灯片1.JPG
34.1 KB, 下载次数: 46)
24.7 KB, 下载次数: 25)
[ 本帖最后由 torte 于 2010-11-17 23:58 编辑 ]
298 KB, 下载次数: 45)
QUOTE:
VBA特效QUOTE:
什么是VBA啊无标题.gif
(2010-11-22 23:07:43, Size: 19.8 KB, Downloads: 36)