为什么这个VB程序运行的时候点击按钮总是出现“编译错误:未找到方法或数据成员?”
我的程序代码是这样写的:PrivateSubCommand1_Click()full=40IfOption2.Value=TrueThenmark=fullElsemar...
我的程序代码是这样写的:
Private Sub Command1_Click()
full = 40
If Option2.Value = True Then
mark = full
Else
mark = full - 2
End If
If Option6.Value = True Then
mark = mark
Else
mark = mark - 2
End If
If Option10.Value = True Then
mark = mark
Else
mark = mark - 2
End If
If Option14.Value = True Then
mark = mark
Else
mark = mark - 2
End If
If Option18.Value = True Then
mark = mark
Else
mark = mark - 2
End If
If Option22.Value = True Then
mark = mark
Else
mark = mark - 2
End If
If Option26.Value = True Then
mark = mark
Else
mark = mark - 2
End If
If Option30.Value = True Then
mark = mark
Else
mark = mark - 2
End If
If Option34.Value = True Then
mark = mark
Else
mark = mark - 2
End If
If Option38.Value = True Then
mark = mark
Else
mark = mark - 2
End If
If Check1.Value = 1 And Check2.Value = 1 Then
mark = mark
Else
mark = mark - 2
End If
If Check6.Value = 1 And Check7.Value = 1 Then
mark = mark
Else
mark = mark - 2
End If
If Check11.Value = 1 And Check12.Value = 1 Then
mark = mark
Else
mark = mark - 2
End If
If Check16.Value = 1 And Check17.Value = 1 Then
mark = mark
Else
mark = mark - 2
End If
If Option41.Value = True Then
mark = mark
Else
mark = mark - 2
End If
If Option44.Value = True Then
mark = mark
Else
mark = mark - 2
End If
If Option45.Value = True Then
mark = mark
Else
mark = mark - 2
End If
If Option48.Value = True Then
mark = mark
Else
mark = mark - 2
End If
If Option49.Value = True Then
mark = mark
Else
mark = mark - 2
End If
Label3.Caption = mark
End Sub
下面是对象窗口的截图: 展开
Private Sub Command1_Click()
full = 40
If Option2.Value = True Then
mark = full
Else
mark = full - 2
End If
If Option6.Value = True Then
mark = mark
Else
mark = mark - 2
End If
If Option10.Value = True Then
mark = mark
Else
mark = mark - 2
End If
If Option14.Value = True Then
mark = mark
Else
mark = mark - 2
End If
If Option18.Value = True Then
mark = mark
Else
mark = mark - 2
End If
If Option22.Value = True Then
mark = mark
Else
mark = mark - 2
End If
If Option26.Value = True Then
mark = mark
Else
mark = mark - 2
End If
If Option30.Value = True Then
mark = mark
Else
mark = mark - 2
End If
If Option34.Value = True Then
mark = mark
Else
mark = mark - 2
End If
If Option38.Value = True Then
mark = mark
Else
mark = mark - 2
End If
If Check1.Value = 1 And Check2.Value = 1 Then
mark = mark
Else
mark = mark - 2
End If
If Check6.Value = 1 And Check7.Value = 1 Then
mark = mark
Else
mark = mark - 2
End If
If Check11.Value = 1 And Check12.Value = 1 Then
mark = mark
Else
mark = mark - 2
End If
If Check16.Value = 1 And Check17.Value = 1 Then
mark = mark
Else
mark = mark - 2
End If
If Option41.Value = True Then
mark = mark
Else
mark = mark - 2
End If
If Option44.Value = True Then
mark = mark
Else
mark = mark - 2
End If
If Option45.Value = True Then
mark = mark
Else
mark = mark - 2
End If
If Option48.Value = True Then
mark = mark
Else
mark = mark - 2
End If
If Option49.Value = True Then
mark = mark
Else
mark = mark - 2
End If
Label3.Caption = mark
End Sub
下面是对象窗口的截图: 展开
2个回答
展开全部
问题:
1、单选题第一题--第十题只需要四个Option(数组)就可以,Option1(0)-Option1(3)
2、多选题第一题-第五题只需要五个Check(数组)就可以:Check1(0)-Check1(4)
3、同样判断题也只需二个Option(数组)就可以,Option2(0)-Option2(1)
在同一窗体同一选择控件需要使用控件数组。
4、在程序中如果Option2为假,那么mark的值为0
5、多选题的判断有问题,不可能每次只选择二种。
6、试题题目不要设置在界面设计时的Frame的Caption属性中,可以将题目存储在文件中(例如文本文件),一个题一个题调用即可。这样界面简单,答题人操作方便。
1、单选题第一题--第十题只需要四个Option(数组)就可以,Option1(0)-Option1(3)
2、多选题第一题-第五题只需要五个Check(数组)就可以:Check1(0)-Check1(4)
3、同样判断题也只需二个Option(数组)就可以,Option2(0)-Option2(1)
在同一窗体同一选择控件需要使用控件数组。
4、在程序中如果Option2为假,那么mark的值为0
5、多选题的判断有问题,不可能每次只选择二种。
6、试题题目不要设置在界面设计时的Frame的Caption属性中,可以将题目存储在文件中(例如文本文件),一个题一个题调用即可。这样界面简单,答题人操作方便。
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询