VB.net阅读列表视图,从多列 [英] VB.net Reading from ListViews with Multiple Columns

查看:147
本文介绍了VB.net阅读列表视图,从多列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好吧。所以,我能够了解如何从第一列读取,但我需要他们两个阅读。我使用的全行选择,我需要在那里。

下面是code,我用得到它的第一列。

 暗淡我作为整数
对于i = 0到ListView1.SelectedItems.Count  -  1
    MSGBOX(ListView1.SelectedItems(I)。文)
下一个
 

解决方案

Tim的答案是正确的,这是它只是一个变种:

 对于每个项目的ListViewItem在ListView1.SelectedItems
    的Debug.WriteLine(COL1 {0},col2的{1},item.Text,item.SubItems(1)。文)
下一个
 

Alright. So I was able to find out how to read from the first column but I need to read from both of them. I am using full row select which I need on there.

Here is the code I am using to get it for the first column.

Dim I As Integer
For I = 0 To ListView1.SelectedItems.Count - 1
    MsgBox(ListView1.SelectedItems(I).Text)
Next

解决方案

Tim's answer is correct this is just a variant of it:

For Each item As ListViewItem In ListView1.SelectedItems
    Debug.WriteLine("Col1 {0}, Col2 {1}", item.Text, item.SubItems(1).Text)
Next

这篇关于VB.net阅读列表视图,从多列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆