Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

ListViewItem.Selected Property

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

[Visual Basic]
Public Property Selected As Boolean
[C#]
public bool Selected {get; set;}
[C++]
public: __property bool get_Selected();
public: __property void set_Selected(bool);
[JScript]
public function get Selected() : Boolean;
public function set Selected(Boolean);

Property Value

true if the item is selected; otherwise, false.

Remarks

If the MultiSelect property of the 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 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 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 ListView control by using the ListView.SelectedItems property.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework

See Also

ListViewItem Class | ListViewItem Members | System.Windows.Forms Namespace | SelectedItems | SelectedIndices

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.