vb list 复选框
高手给小弟一段代码在list中添加5项abcde然后让ace复选上然后用forifa=复选thenmsgboxa谢谢了...
高手给小弟一段代码
在 list中添加5项 a b c d e
然后 让a c e 复选上
然后用for if a = 复选 then msgbox a 谢谢了 展开
在 list中添加5项 a b c d e
然后 让a c e 复选上
然后用for if a = 复选 then msgbox a 谢谢了 展开
1个回答
展开全部
Private Sub Form_Load()
'属性栏内设置:List1.Style = 1
'初始化
For i = 65 To 69
List1.AddItem Chr(i)
Next i
Me.Show
'设置a,c,e选中
For i = 0 To List1.ListCount - 1
If LCase(List1.List(i)) = "a" Then
List1.Selected(i) = True
MsgBox List1.List(i) & "选中了,谢谢"
End If
If LCase(List1.List(i)) = "c" Then
List1.Selected(i) = True
MsgBox List1.List(i) & "选中了,谢谢"
End If
If LCase(List1.List(i)) = "e" Then
List1.Selected(i) = True
MsgBox List1.List(i) & "选中了,谢谢"
End If
Next i
End Sub
'属性栏内设置:List1.Style = 1
'初始化
For i = 65 To 69
List1.AddItem Chr(i)
Next i
Me.Show
'设置a,c,e选中
For i = 0 To List1.ListCount - 1
If LCase(List1.List(i)) = "a" Then
List1.Selected(i) = True
MsgBox List1.List(i) & "选中了,谢谢"
End If
If LCase(List1.List(i)) = "c" Then
List1.Selected(i) = True
MsgBox List1.List(i) & "选中了,谢谢"
End If
If LCase(List1.List(i)) = "e" Then
List1.Selected(i) = True
MsgBox List1.List(i) & "选中了,谢谢"
End If
Next i
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询