Share via


ISelectionProvider.IsSelectionRequired 屬性

定義

取得值,指定使用者介面自動化提供者是否需要至少選取一個子項目。

public:
 property bool IsSelectionRequired { bool get(); };
public bool IsSelectionRequired { get; }
member this.IsSelectionRequired : bool
Public ReadOnly Property IsSelectionRequired As Boolean

屬性值

Boolean

如果需要選取,則為 true;否則為 false

範例

下列範例會針對需要隨時選取專案的清單,顯示這個方法的實作。

/// <summary>
/// Specifies whether the list must have an item selected at all times.
/// </summary>
bool ISelectionProvider.IsSelectionRequired
{
    get
    {
        return true;
    }
}
''' <summary>
''' Specifies whether the list must have an item selected at all times.
''' </summary>
Private ReadOnly Property IsSelectionRequired() As Boolean Implements ISelectionProvider.IsSelectionRequired
    Get
        Return True
    End Get
End Property

備註

此屬性可以是動態屬性。 例如,控制項的初始狀態預設可能不會選取任何專案,這表示 IsSelectionRequiredfalse 。 不過,在選取項目之後,控制項就必須至少有一個項目一律保持為選取。

適用於

另請參閱