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 可能會在 Visual Basic) Nothing 中傳回 null 參考 (。

適用於

另請參閱