求vb制作选择题代码

来源:百度知道 编辑:UC知道 时间:2024/05/19 16:11:45
我想用vb做4道选择题(每道题4个选项) 4道题总共一个确定按钮
2道单择题(比如都选第一项) 2道多选题(比如都选第一二两项)
都选对的话按确定退出 否则哪道题错了就弹出窗口提示错误的是哪一道
这段代码怎么写啊? 先谢谢各位大仙儿了~

控件列表:
label1
label2
label3
label4
(以上为题目方框)
frame1
frame2
frame3
frame4
(以上为4题的选择内容框)
option1
option2
option3
option4
option5
option6
option7
option8
(以上为单选题按钮)
check1
check2
check3
check4
check5
check6
check7
check8
(以上为多选题按钮)
command1
(确认按钮)
(假设单选题都是第1个对,多选题都是第1和2对
private sub command1_click()
if option1=false then
msgbox "第1题错了"
elseif option5=false then
msgbox "第2题错了"
elseif check1.value=0 or check2.value=0 or check3.value=1 or check4.value=1 then
msgbox "第3题错了"
elseif check5.value=0 or check6.value=0 or check7.value=1 or check8.value=1 then
msgbox "第4题错了"
else
if msgbox ("退出吗")=vbOK then
unload me
end if
end if
end sub

你把选择题和答案发给我
happyq6@163.com
我给你做吧