for(i=0;i=listbox.listcount;i++)
{
  if(listbox.items(i).select=true)
  {
      TEXT+=listbox.items(i).text;
  }
}

解决方案 »

  1.   

    Dim I As Integer
    For I = 0 To List1.ListCount - 1
     If  List1.Selected(I) = True Then
      '此条被选中
     EndIf
    Next I
      

  2.   

    to  cuiyxy(沧海鲨鱼)
      我知道它是被选中了,可是我如果是选择的多条的话,我怎么把这几条的TEXT 一起返回呢,因为我要用这几条的TEXT 
      

  3.   

    你的问题说的不是太明了!你所说的返回是什么意思?在什么地方显示你的返回值?如果你想多行显示你的可选项的话——List1.AddItem "aaa" 
                                List1.AddItem "bbb"
                                List1.AddItem "ccc"
    这样在这个控件中就有三个选项aaa,bbb,ccc了!
      

  4.   

    '要试作此例,请在窗体中加入一个列表框和一个按钮,并且ListBox的Style设为1 - CheckBox
    '然后粘贴如下代码Private Sub Form_Load()
        List1.AddItem "aa"
        List1.AddItem "bb"
        List1.AddItem "cc"
        List1.AddItem "dd"
        List1.AddItem "ee"
        List1.AddItem "ff"
    End SubPrivate Sub Command1_Click()
        Dim lngIndex As Long
        
        For lngIndex = 0 To List1.ListCount - 1
            If List1.Selected(lngIndex) Then
                MsgBox List1.List(lngIndex)
            End If
        Next
    End Sub
      

  5.   

    to setfocus(脸谱)
      你的理解能力也太那个了吧,老兄,我要用到LISTBOX 里的多项数据,这个LISTBOX已经填充完,比方这样说,现在LISTBOX里面有四项,我想在里面的两项前的CHECKBOX里打勾,选中后我要用打勾两项后面所对应的STRING值。
      

  6.   

    这还不简单吗?
    For i = 0 To Me.List1.ListCount
      If Me.List1.Selected(i) = True Then
        MsgBox Me.List1.List(i)
      End If
    Next
    这不取到你要的了吗?
      

  7.   

    呵呵!原来是这样!
    Private Sub List1_ItemCheck(Item As Integer)Label1.Caption = List1.List(Item)
     
        
    End Sub
    这 下 你 该 满 足 了 吧!