System.Windows.Forms.ListBox.GetSelected Method

Returns a value indicating whether the specified item is selected.

Syntax

public bool GetSelected (int index)

Parameters

index
The zero-based index of the item that determines whether it is selected.

Returns

true if the specified item is currently selected in the System.Windows.Forms.ListBox; otherwise, false.

Remarks

You can use this method to quickly determine whether a specified item is selected. This method is useful when a specific operation needs to be performed when a specific item in a multiple-selection System.Windows.Forms.ListBox is selected.

Requirements

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