在我的窗口应用程序中,我有 4 列的列表视图。我想检查所有行中的第三个子项是否为空。如果它是空的,我需要提示错误。如何检查子项 3 没有任何价值观?
问问题
2317 次
1 回答
0
像这样的东西应该工作:
For Each Itm As ListViewItem In ListView1.Items
'The orelse shortcut really works well here, since if the subitem doesn't
'exist it won't check if the text is empty
If Itm.SubItems.Count < 4 OrElse Itm.SubItems(3).Text = "" Then
MsgBox(Itm.Text)
End If
Next
这将检查第四列的子项是否存在,或者如果存在,则它具有值。更改子项索引以选择不同的列。
于 2013-06-15T04:50:26.597 回答