System.Windows.Forms.ListViewItem.Selected Property

Gets or sets a value indicating whether the item is selected.

Syntax

[System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
[System.ComponentModel.Browsable(false)]
public bool Selected { set; get; }

Value

Documentation for this section has not yet been entered.

Remarks

If the ListView.MultiSelect property of the System.Windows.Forms.ListView control the item is contained in is set to true, setting the value of this property adds or removes the item from the set of selected items. If the ListView.MultiSelect property is set to false, setting the value of this property to select an item automatically cancels the selection for any other items in the System.Windows.Forms.ListView control. You can use this property to determine if an item is selected or to select an item at run time. You can access all items that are selected in a System.Windows.Forms.ListView control by using the ListView.SelectedItems property.

Note:

Items appear selected only when the System.Windows.Forms.ListView control has focus. To select items in response to a user action such as a button click, be sure to call the Control.Focus method in addition to setting this 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