Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
现在,我知道如何添加子项了,但这一次与我通常的方法略有不同。下面是我用来将项目添加到我的列表视图的内容,但是使用它我无法弄清楚如何添加子项目。
listView1.Items.Add(Path.GetFileName(f));
尝试这个:
listView1.Items.Add(Path.GetFileName(f)); listView1.Items[0 /* or any index you need */].SubItems.Add("SubItem");