共用方式為


ISelectionItemProvider.Select 方法

定義

取消選取任何已選取的項目,然後選取目前的項目。

public:
 void Select();
public void Select ();
abstract member Select : unit -> unit
Public Sub Select ()

範例

下列範例程式代碼會清除所選專案集合中的所有專案,然後新增此專案。

/// <summary>
/// Selects the item.
/// </summary>
/// <remarks>
/// selectedItems is the collection of selected ListItems.
/// </remarks>
public void Select()
{
    selectedItems.Clear();
    selectedItems.Add(this);
    // TODO: Update UI.
}
''' <summary>
''' Selects the item.
''' </summary>
''' <remarks>
''' selectedItems is the collection of selected ListItems.
''' </remarks>
Public Sub [Select]() Implements ISelectionItemProvider.Select
    selectedItems.Clear()
    selectedItems.Add(Me)
    ' TODO: Update UI.
End Sub

適用於

另請參閱