Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/299.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/reactjs/25.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C#WinForms列表框是否在ListView中选择了等效索引?_C# - Fatal编程技术网

C#WinForms列表框是否在ListView中选择了等效索引?

C#WinForms列表框是否在ListView中选择了等效索引?,c#,C#,ListView中的ListBox SelectedIndex等效于什么? 如何在ListView中编写以下代码 if(listbox.SelectedIndex == -1) { } 有两种方法可以检查您是否选择了项目 if(listview.SelectedItems.Count > 0) { } 或 如果“multisect”为true,则此集合中可以有多个元素,否则仅选定项 if(listview.SelectedIndices.Count > 0) {

ListView中的ListBox SelectedIndex等效于什么? 如何在ListView中编写以下代码

if(listbox.SelectedIndex == -1)
{

}

有两种方法可以检查您是否选择了项目

if(listview.SelectedItems.Count > 0) 
{ 

} 

如果“multisect”为true,则此集合中可以有多个元素,否则仅选定项

if(listview.SelectedIndices.Count > 0) 
{ 

}