System.Windows.Forms.ListView.SelectedItems Property

Gets the items that are selected in the control.

Syntax

[System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
[System.ComponentModel.Browsable(false)]
public ListView.SelectedListViewItemCollection SelectedItems { get; }

Value

Documentation for this section has not yet been entered.

Remarks

The ListView.SelectedItems property will not contain any items if the property is accessed before the System.Windows.Forms.ListView handle is created, which typically occurs when System.Windows.Forms.ListView is initially loaded for display in the form. You can check to see if the handle is created with the Control.IsHandleCreated property. When the ListView.MultiSelect property is set to true, this property returns a collection containing the items that are selected in the System.Windows.Forms.ListView. For a single-selection System.Windows.Forms.ListView, this property returns a collection containing the only selected item in the System.Windows.Forms.ListView. For more information on the tasks that can be performed with the items in the collection, see System.Windows.Forms.ListView.SelectedListViewItemCollection.

If you want to obtain a collection of the index positions within the System.Windows.Forms.ListView.ListViewItemCollection of the items that are selected in the System.Windows.Forms.ListView control, instead of the items that are selected, use the ListView.SelectedIndices property.

Requirements

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0