求教如何把listview里的数据读如内存,谢谢!!!
有listview,listview1,command1,command2,command3
按command1把aa.dat数据显示在listview里
按command2把bb.dat数据显示在listview里,并把原显示在listview里的数据读入内存
我想实现按command1把内存里的数据显示在listview1里

解决方案 »

  1.   

    谢谢!!!!
    请您看看我的这个错在何处,谢谢!!!!
    把listview里的数据加入到数主力
    模块:
    Public Type DownInfo
        mUrl As String   
    End Type
    Public mDownInfo() As DownInfo
    窗体:
    Private Sub Command1_Click()
    dim i 
    ReDim Preserve mDownInfo(i)
    i=1
    for i=1 to Listview1.ListItems.Count
    mDownInfo(i).mUrl=Listview1.ListItems(i).Text '错误提示:下界越标
    msgbox mDownInfo(i).mUrl
    next i
    End Sub
      

  2.   

    'ReDim Preserve mDownInfo(i)
    改成 ReDim Preserve mDownInfo(listview1.listitems.count)
      

  3.   

    Public Type DownInfo
        mUrl As String   
    End Type
    Public mDownInfo() As DownInfo
    窗体:
    Private Sub Command1_Click()
    dim i as long
    ReDim mDownInfo(Listview1.ListItems.Count-1)
    for i=0 to Ubound(mDownInfo)
    mDownInfo(i).mUrl=Listview1.ListItems(i+1).Text '错误提示:下界越标
    msgbox mDownInfo(i).mUrl
    next i
    End Sub