語言

ITextProvider.GetSelection 方法

定義

擷取與當前文本選擇相關的不相交文字範圍集合。

public:
 cli::array <System::Windows::Automation::Provider::ITextRangeProvider ^> ^ GetSelection();
public System.Windows.Automation.Provider.ITextRangeProvider[] GetSelection();
abstract member GetSelection : unit -> System.Windows.Automation.Provider.ITextRangeProvider[]
Public Function GetSelection () As ITextRangeProvider()

傳回

一組不相交的文字範圍。

例外狀況

如果 使用者介面自動化 服務提供者不支援文字選擇,

備註

對於支援文字選擇的使用者介面自動化提供者,提供者應實作此方法,並回傳 SupportedTextSelection 值。

若未選取文字,則回 GetSelection 傳系統游標位置(文字插入點)的退化文字範圍(空值範圍)。

若系統游標(文字插入點)不存在,GetSelection 可能會回傳空參考(Nothing Visual Basic)。

適用於

另請參閱