怎样判断listbox框中的所有选项没被选中?

fsroger 2002-07-08 04:52:08
怎样判断listbox框中的所有选项没被选中?
...全文
300 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
fsroger 2002-07-10
  • 打赏
  • 举报
回复
终于搞定了,不过我说的是listbox
Bird_L 2002-07-08
  • 打赏
  • 举报
回复
if list.lsitindex=-1 then
msgbox"没有选中"
end if
ccbl 2002-07-08
  • 打赏
  • 举报
回复
同意楼上的
griefforyou 2002-07-08
  • 打赏
  • 举报
回复
Option Explicit

Private Sub Command1_Click()
Dim i As Integer
For i = 0 To List1.ListCount - 1
If List1.Selected(i) = False Then
Exit For
End If
Next

If i < List1.ListCount Then
MsgBox "没有全选"
Else
MsgBox "全选"
End If
End Sub

Private Sub Form_Load()
Dim i As Integer
For i = 0 To 10
List1.AddItem "text" & i
Next
End Sub
blueer 2002-07-08
  • 打赏
  • 举报
回复
If listbox1.selcount=0 then
msgbox "None Item selected"
End if
sinopec_fjnp 2002-07-08
  • 打赏
  • 举报
回复
i=list1.listindex
如果i=-1表示没有选中
记得结帖啊

7,763

社区成员

发帖
与我相关
我的任务
社区描述
VB 基础类
社区管理员
  • VB基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧