vb.net中的listview帮助 [英] help with listview in vb.net

查看:64
本文介绍了vb.net中的listview帮助的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用列表视图显示数据.我可以将第一个2变量放入自己的列中,但不能进入分层列.请注意下面列出的代码:

Im using a listview to display data. I can get the frist 2 variables to go into thier own columns but not the tierd. note the code listed below:

Dim process = GetObject("winmgmts://./root/novadigm:NVD_Agent")
Dim method = process.Methods_("GetValue")
Dim inParameters = method.inParameters.SpawnInstance_()
inParameters.Path = strObject
Dim outParameters = process.ExecMethod_("NumberOfInstances", inParameters)
Dim StrHeaps = (outParameters.InstanceCount)
num_TextBox.Text = StrHeaps
For i = 0 To StrHeaps Step +1
    inParameters.Index = i

    inParameters.Property = "ZOBJNAME"
    outParameters = process.ExecMethod_("GetValue", inParameters)
    Dim Value1 As String = outParameters.Value

    inParameters.Property = "ZAVIS"
    outParameters = process.ExecMethod_("GetValue", inParameters)
    Dim Value2 As String = outParameters.Value

    inParameters.Property = "NAME"
    outParameters = process.ExecMethod_("GetValue", inParameters)
    Dim Value3 As String = outParameters.Value

    ListView1.Items.Add(Value1).SubItems.Add(Value2)


Next




帮助将是巨大的.请不要发布其他文章以供阅读,我只需要编码方面的帮助.




help would be great. please dont post other articles to go read i just need help with the coding.

推荐答案

将您的代码更改为
Change your code to
ListViewItem item1 = new ListViewItem("item1",Value1);
item1.SubItems.Add(Value2);
item1.SubItems.Add(Value3);
listView1.Items.Add(item1);



这应该添加所有子项.

作为参考,请通过 [



This should add all subitems.

For reference, go through this[^] definition of the SubItem property.


这篇关于vb.net中的listview帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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