Share via


TextPattern.SupportedTextSelection 屬性

定義

取得值,可指定文字提供者是否支援選取範圍;如果支援,則指定支援的選取範圍類型。

public:
 property System::Windows::Automation::SupportedTextSelection SupportedTextSelection { System::Windows::Automation::SupportedTextSelection get(); };
public System.Windows.Automation.SupportedTextSelection SupportedTextSelection { get; }
member this.SupportedTextSelection : System.Windows.Automation.SupportedTextSelection
Public ReadOnly Property SupportedTextSelection As SupportedTextSelection

屬性值

其中一個 SupportedTextSelection 值。

範例

// Does target range support text selection?
if (targetTextPattern.SupportedTextSelection ==
    SupportedTextSelection.None)
{
    targetResult.Content = "Unable to select text.";
    targetResult.Background = Brushes.Salmon;
    return;
}
// Does target range support multiple selections?
if (targetTextPattern.SupportedTextSelection ==
    SupportedTextSelection.Multiple)
{
    targetResult.Content = "Multiple selections present.";
    targetResult.Background = Brushes.Salmon;
    return;
}
' Does target range support text selection?
If targetTextPattern.SupportedTextSelection = SupportedTextSelection.None Then
    targetResult.Content = "Unable to select text."
    targetResult.Background = Brushes.Salmon
    Return
End If
' Does target range support multiple selections?
If targetTextPattern.SupportedTextSelection = SupportedTextSelection.Multiple Then
    targetResult.Content = "Multiple selections present."
    targetResult.Background = Brushes.Salmon
    Return
End If

適用於

另請參閱