(2010-12-08 22:12:31, Size: 15 KB, Downloads: 62)
10.12.08简单的单选题
笨巧果 发表于: 2010-12-08 22:12 来源: 扑奔PPT网
大家对 10.12.08简单的单选题 的评论
最新PPT模板
最新贴子
PPT热贴
笨巧果 发表于: 2010-12-08 22:12 来源: 扑奔PPT网
(2010-12-08 22:12:31, Size: 15 KB, Downloads: 62)
幻灯片1.JPG
幻灯片2.JPG
16.3 KB, 下载次数: 50)
幻灯片1.JPG
幻灯片2.JPG
幻灯片3.JPG
23.9 KB, 下载次数: 36)
幻灯片1.JPG
幻灯片2.JPG
幻灯片3.JPG
幻灯片4.JPG
(2010-12-09 00:22:09, Size: 24.5 KB, Downloads: 48)
多选题的代码
Private Sub CheckBox1_Click()
If CheckBox1.Value = False Then
CheckBox1.Value = True
a.Caption = ""
Else
CheckBox1.Value = False
a.Caption = "A"
End If
End Sub
Private Sub CheckBox2_Click()
If CheckBox2.Value = False Then
CheckBox2.Value = True
B.Caption = ""
Else
CheckBox2.Value = False
B.Caption = "B"
End If
End Sub
Private Sub CheckBox3_Click()
If CheckBox3.Value = False Then
CheckBox3.Value = True
D.Caption = ""
Else
CheckBox3.Value = False
D.Caption = "D"
End If
End Sub
Private Sub CheckBox4_Click()
If CheckBox4.Value = False Then
CheckBox4.Value = True
C.Caption = ""
Else
CheckBox4.Value = False
C.Caption = "C"
End If
End Sub
Private Sub tijiao_Click()
If CheckBox1.Value = True And CheckBox2.Value = False _
And CheckBox3.Value = False And CheckBox4.Value = False Then
MsgBox ("恭喜你,答对了!")
Else
MsgBox ("很遗憾,答错了!")
End If
End Sub
Private Sub qingkong_Click()
CheckBox1.Value = False
CheckBox2.Value = False
CheckBox3.Value = False
CheckBox4.Value = False
a.Caption = ""
B.Caption = ""
C.Caption = ""
D.Caption = ""
End Sub
51.4 KB, 下载次数: 44)
23.6 KB, 下载次数: 28)
(2010-12-09 19:40:09, Size: 17 KB, Downloads: 42)
20101208果果老师单选动画.jpg
Private Sub tijiao_Click()
If CheckBox1.Value = True And CheckBox2.Value = False And CheckBox3.Value = True And CheckBox4.Value = True Then
defen.Caption = "40"
MsgBox ("恭喜你,答对了!")
'以上为完全正确
ElseIf CheckBox2.Value = True Then
defen.Caption = "0"
MsgBox ("很遗憾,答错了!")
'以上为错误答案
ElseIf CheckBox1.Value = False And CheckBox2.Value = False And CheckBox3.Value = False And CheckBox4.Value = False Then
defen.Caption = "0"
MsgBox ("请进行选择!")
'以上为未进行选择
Else
If CheckBox1.Value = True Then
If CheckBox3.Value = True Or CheckBox4.Value = True Then
defen.Caption = "20"
'以上为选中1、3或1、4,得20分
Else
defen.Caption = "10"
'以上为只选中1,得10分
End If
Else
If CheckBox3.Value = True And CheckBox4.Value = True Then
defen.Caption = "20"
'以上为选中3、4,得20分
Else
defen.Caption = "10"
'以上为只选中3或4,得10分
End If
End If
MsgBox ("选择不完整!")
'以上几种情况均弹出选择不完整对话框
End If
End Sub
(2010-12-10 18:06:01, Size: 22 KB, Downloads: 52)
QUOTE:
您在checkbox的单击事件中,更改了checkbox的value值,造成了代码错误。QUOTE:
试试我整理的代码效果Private Sub tijiao_Click()
If CheckBox2.Value = True Then
defen.Caption = "0"
MsgBox ("很遗憾,答错了!")
ElseIf CheckBox1.Value = True And CheckBox3.Value = True And CheckBox4.Value = True Then
defen.Caption = "40"
MsgBox ("恭喜你,答对了!")
ElseIf CheckBox1.Value = True And CheckBox3.Value = False And CheckBox4.Value = False Or CheckBox3.Value = True And CheckBox1.Value = False And CheckBox4.Value = False Or CheckBox4.Value = True And CheckBox1.Value = False And CheckBox3.Value = False Then
defen.Caption = "10"
MsgBox ("选择不完整!")
Else
defen.Caption = "20"
MsgBox ("选择不完整!")
End If
End Sub