次の方法で共有


UI オートメーションのテキスト属性

このトピックでは、Microsoft UI オートメーションがテキスト コンテンツの形式とスタイルのプロパティ (テキスト属性) を公開する方法について説明し、サポートされているテキスト属性の一覧を提供します。

UI オートメーション プロバイダーは、の GetAttributeValue を使用してテキスト属性を公開し、TextRange コントロール パターンの FindAttributeメソッドをします。 クライアント アプリケーションでは、IUIAutomationTextRange::GetAttributeValue メソッドを使用して、テキスト範囲の特定のテキスト属性の値を取得します。 クライアントは、IUIAutomationTextRange::FindAttribute メソッドを使用して、特定の属性を持つテキストのテキスト範囲を検索できます。 一致するテキストが見つかった場合、メソッドは一致するテキストを含む新しいテキスト範囲を作成します。

次の一覧のテキスト属性は、TextRange コントロール パターンでサポートされています。 属性名は、UI オートメーションのテキスト属性識別子から派生します。 たとえば、AnimationStyle 属性は、クライアントによって UIA_AnimationStyleAttributeId (Uiautomationclient.h で定義) およびプロバイダーによって Text_AnimationStyle_Attribute_GUID (Uiautomationcoreapi.h で定義) として識別されます。 サポートされている各テキスト属性の詳細については、「テキスト属性識別子の」を参照してください。

手記

一覧表示されている属性の一部は、Windows 8 以降でサポートされています。 バージョンのサポートに関する注意事項については、「テキスト属性識別子の」を参照してください。

 

このトピックには、次のセクションが含まれています。

注釈属性

注釈オブジェクトと注釈の種類は、次の属性を使用して使用できます。

属性 識別子
AnnotationObjects UIA_AnnotationObjectsAttributeId
AnnotationTypes UIA_AnnotationTypesAttributeId

 

フォント属性

フォントの名前、サイズ、および太さは、次の属性を使用して使用できます。

属性 識別子
FontName UIA_FontNameAttributeId
FontSize UIA_FontSizeAttributeId
FontWeight UIA_FontWeightAttributeId

 

言語属性

テキストの言語に関する情報は、次の属性を使用して入手できます。

属性 識別子
カルチャ UIA_CultureAttributeId
TextFlowDirections UIA_TextFlowDirectionsAttributeId

 

次の属性は、ドキュメント内のリンクのターゲットであるテキスト範囲を提供します。

属性 識別子
リンク UIA_LinkAttributeId

 

ページ余白の属性

テキスト範囲の外接する四角形は、ページ内のテキストの座標を公開しません。 ただし、プロバイダーは、次のテキスト属性を使用してページ余白情報を公開できます。

属性 識別子
MarginBottom する UIA_MarginBottomAttributeId
MarginLeading UIA_MarginLeadingAttributeId
MarginTop UIA_MarginTopAttributeId
marginTrailing UIA_MarginTrailingAttributeId

 

テキスト配置属性

インデント、タブ設定、水平方向の配置などのテキストの配置に関する情報は、次の属性を使用して使用できます。

属性 識別子
HorizontalTextAlignment UIA_HorizontalTextAlignmentAttributeId
インデントFirstLine UIA_IndentationFirstLineAttributeId
インデントの表示 UIA_IndentationLeadingAttributeId
インデントの UIA_IndentationTrailingAttributeId
タブの UIA_TabsAttributeId

 

テキストの色の属性

前景色と背景のテキストの色は、次のテキスト属性を使用して使用できます。 どちらの色も、COLORREF データ型として指定されます。

属性 識別子
BackgroundColor UIA_BackgroundColorAttributeId
ForegroundColor UIA_ForegroundColorAttributeId

 

テキスト装飾属性

テキスト装飾には、箇条書き、下線、アニメーションなどの領域が含まれます。 テキストに先頭の行頭文字または番号が含まれている場合は、該当する場合は、行頭文字または番号に使用される記号またはテキストをテキスト ストリームに含める必要があります。

テキスト装飾に関する情報は、次の属性を使用して使用できます。

属性 識別子
AnimationStyle UIA_AnimationStyleAttributeId
BulletStyle UIA_BulletStyleAttributeId
OutlineStyles UIA_OutlineStylesAttributeId
OverlineColor する UIA_OverlineColorAttributeId
OverlineStyle UIA_OverlineStyleAttributeId
StrikethroughColor UIA_StrikethroughColorAttributeId
StrikethroughStyle UIA_StrikethroughStyleAttributeId
UnderlineColor UIA_UnderlineColorAttributeId
UnderlineStyle UIA_UnderlineStyleAttributeId

 

テキスト スタイル属性

テキスト スタイルに関する情報は、次の属性を使用して使用できます。

属性 識別子
CapStyle UIA_CapStyleAttributeId
IsHidden UIA_IsHiddenAttributeId
IsItalic UIA_IsItalicAttributeId
IsReadOnly UIA_IsReadOnlyAttributeId
IsSuperscript UIA_IsSuperscriptAttributeId
IsSubscript UIA_IsSubscriptAttributeId

 

相互作用属性と選択属性

範囲とフォーカス状態の現在のテキスト選択に関する情報は、次の属性を使用して使用できます。

属性 識別子
IsActive UIA_IsActiveAttributeId
SelectionActiveEnd UIA_SelectionActiveEndAttributeId
CaretPosition UIA_CaretPositionAttributeId
CaretBidiMode UIA_CaretBidiModeAttributeId

 

概念

UI オートメーションの Text および TextRange コントロール パターンについて

Text および TextRange コントロール パターン

テキスト ベースのコントロールの操作