从列表视图中提取数据

时间:2017-01-20 13:50:53

标签: vb.net for-loop while-loop

我有一个列表视图框,有5列,最多25行。我想从中导出数据。我在这里的代码效果很好:

Dim rtb As New RichTextBox 
rtb.AppendText("Gen, Juv, Adult, Senile, Total" & vbNewLine)

For Each BitofData As ListViewItem In Results.ModelData.Items
    rtb.AppendText(
        BitofData.Text & "," &
        BitofData.SubItems(1).Text & "," &
        BitofData.SubItems(2).Text & "," &
        BitofData.SubItems(3).Text & "," &
        BitofData.SubItems(4).Text & vbNewLine)
Next
rtb.SaveFile(Address, RichTextBoxStreamType.PlainText)

但是如何将其作为另一种迭代形式编写。例如,for循环或while循环??

0 个答案:

没有答案