当把列表框的style设置成1-checkbox时怎样取出列表框(List1)里面所有被选中项的值?

解决方案 »

  1.   

    Option ExplicitPrivate Sub Command1_Click()
      Dim i As Integer
      
      For i = 0 To Me.List1.ListCount - 1
         If Me.List1.Selected(i) = True Then
           Debug.Print Me.List1.List(i)
         End If
      Next i
    End SubPrivate Sub Form_Load()
      With Me.List1
        .AddItem "111"
        .AddItem "222"
        .AddItem "333"
        .AddItem "444"
        .AddItem "555"
        .AddItem "666"
        .AddItem "777"
        .AddItem "888"
        .AddItem "999"
      End With
    End Sub