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()

返品

不整合なテキスト範囲のコレクション。

例外

UI オートメーション プロバイダーがテキストの選択をサポートしていない場合。

注釈

テキストの選択をサポートするUI オートメーションプロバイダーの場合、プロバイダーはこのメソッドを実装し、SupportedTextSelection 値も返す必要があります。

テキストが選択されていない場合、 GetSelection はシステム カーソル (テキスト挿入ポイント) の位置にある縮退したテキスト範囲 (空の範囲) を返します。

システム カーソル (テキスト挿入ポイント) が存在しない場合、GetSelection は null 参照 (Visual Basic では Nothing) を返す可能性があります。

適用対象

こちらもご覧ください