vb 复选框用Check1.Value = Checked的时候就自动运行了Check1_Click.怎么办?
来源:学生作业帮 编辑:神马作文网作业帮 分类:综合作业 时间:2024/11/17 23:57:31
vb 复选框用Check1.Value = Checked的时候就自动运行了Check1_Click.怎么办?
程序如图
代码如下:
Private Sub Check1_Click()
If Check1.Value = 1 Then
For i = 0 To 39
Check2(i).Value = 1
Next i
ElseIf Check1.Value = 0 Then
For i = 0 To 39
Check2(i).Value = 0
Next i
End If
End Sub
Private Sub Check2_Click(Index As Integer)
Dim Check2ValueChecked,Check2ValueUnchecked As Boolean
Check2ValueChecked = False
Check2ValueUnchecked = False
For i = 0 To 39
If Check2(i).Value = 1 Then
Check2ValueChecked = True
Else
Check2ValueUnchecked = True
End If
Next i
If Check2ValueChecked = True And Check2ValueUnchecked = True Then
Check1.Value = 1
ElseIf Check2ValueChecked = True Or Check2ValueUnchecked = True Then
Check1.Value = 2
Else
Check1.Value = 0
End If
Check2ValueChecked = False
Check2ValueUnchecked = False
End Sub
帮我简化并解决一下吧,我希望check1与check2()共同被选或无选,或check2部分被选时check1.value=2
程序如图
代码如下:
Private Sub Check1_Click()
If Check1.Value = 1 Then
For i = 0 To 39
Check2(i).Value = 1
Next i
ElseIf Check1.Value = 0 Then
For i = 0 To 39
Check2(i).Value = 0
Next i
End If
End Sub
Private Sub Check2_Click(Index As Integer)
Dim Check2ValueChecked,Check2ValueUnchecked As Boolean
Check2ValueChecked = False
Check2ValueUnchecked = False
For i = 0 To 39
If Check2(i).Value = 1 Then
Check2ValueChecked = True
Else
Check2ValueUnchecked = True
End If
Next i
If Check2ValueChecked = True And Check2ValueUnchecked = True Then
Check1.Value = 1
ElseIf Check2ValueChecked = True Or Check2ValueUnchecked = True Then
Check1.Value = 2
Else
Check1.Value = 0
End If
Check2ValueChecked = False
Check2ValueUnchecked = False
End Sub
帮我简化并解决一下吧,我希望check1与check2()共同被选或无选,或check2部分被选时check1.value=2
先解决你的问题:
checkbox在设计时设置其value就不会引发click事件,但如果用代码的话就会引发click事件.
另外你的程序把简单的问题复杂化了,也许是我看得不仔细.
checkbox在设计时设置其value就不会引发click事件,但如果用代码的话就会引发click事件.
另外你的程序把简单的问题复杂化了,也许是我看得不仔细.
关于vb的CheckPrivate Sub Check1_Click()If Check1.Value = 0 Then
英语翻译private sub check1_click()label1.fontbold=iif(check1.val
在窗体上有一个名称为Check1的复选框数组(含4个复选框),还有一个名称为Text1的文本框,初始内容为空.程序运行时
checked="checked"指的是什么意思?
VB中 sum.Value =
VB中的For i = 0 To Check1.Count - 1 是什么意思
vb中Check的Value属性是什么意思
电水壶烧水的时候,水还没有被烧开开关就自动跳掉了,是为什么?
我在装帝国时代3的时候出现的 不知道是怎么回事,用虚拟光驱运行安装就跳出来 安下OK就关了``晕
英语语法看的时候会懂,可是做练习的时候就不会了,怎么办?
checked leehom的checked out
SD敢达运行一段时间后,会弹出一个显示框,里面说了一段英文,然后就必须自动弹出,是怎么一回事?