ISelectionProvider.IsSelectionRequired 属性
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取一个值,该值指定UI 自动化提供程序是否需要至少选择一个子元素。
public:
property bool IsSelectionRequired { bool get(); };
public bool IsSelectionRequired { get; }
member this.IsSelectionRequired : bool
Public ReadOnly Property IsSelectionRequired As 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。 但是,选择某个项后,控件必须始终至少选择一个项。