在listview中多选的时候怎么将多选的数据存放到数组中呢?

解决方案 »

  1.   

    Dim i As Integer
    Dim arrayList() As StringDim aCount As Integer
    aCount = 0ReDim arrayList(0 To ListView1.ListItems.count)    For i = 1 To ListView1.ListItems.count
            If ListView1.ListItems(i).Selected = True Then
                arrayList(aCount) = ListView1.SelectedItem.SubItems(2)
                aCount = aCount + 1
            End If
        Next'输出值
    Dim aa As String
    Dim j As Integer    For j = 0 To aCount - 1
            aa = arrayList(j) & "-" & aa
        Next
    MsgBox aa
      

  2.   

    可以用API
    LVM_GETITEMSTATE获得状态
    都也一样。