Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

TextPattern Class

Represents controls that contain text.

System.Object
  System.Windows.Automation.BasePattern
    System.Windows.Automation.TextPattern

Namespace:  System.Windows.Automation
Assembly:  UIAutomationClient (in UIAutomationClient.dll)
public class TextPattern : BasePattern

The TextPattern type exposes the following members.

  NameDescription
Public propertyDocumentRangeGets a text range that encloses the main text of a document.
Public propertySupportedTextSelectionGets a value that specifies whether a text provider supports selection and, if so, the type of selection supported.
Top
  NameDescription
Public methodEquals(Object)Determines whether the specified object is equal to the current object. (Inherited from Object.)
Protected methodFinalizeFrees resources and performs other cleanup operations before the object is reclaimed by garbage collection. (Inherited from BasePattern.)
Public methodGetHashCodeServes as the default hash function. (Inherited from Object.)
Public methodGetSelectionRetrieves a collection of disjoint text ranges associated with the current text selection or selections.
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodGetVisibleRangesRetrieves an array of disjoint text ranges from a text container where each text range begins with the first partially visible line through to the end of the last partially visible line.
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodRangeFromChildRetrieves a text range enclosing a child element such as an image, hyperlink, Microsoft Excel spreadsheet, or other embedded object. 
Public methodRangeFromPointReturns the degenerate (empty) text range nearest to the specified screen coordinates.
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Top
  NameDescription
Public fieldStatic memberAnimationStyleAttributeIdentifies the AnimationStyle attribute of a text range.
Public fieldStatic memberBackgroundColorAttributeIdentifies the BackgroundColor attribute of a text range.
Public fieldStatic memberBulletStyleAttributeIdentifies the BulletStyle attribute of a text range.
Public fieldStatic memberCapStyleAttributeIdentifies the CapStyle attribute of a text range.
Public fieldStatic memberCultureAttributeIdentifies the Culture (CultureInfo) attribute of a text range down to the sub-language level; for example, French–Switzerland (fr-CH) instead of French (fr).
Public fieldStatic memberFontNameAttributeIdentifies the FontName attribute of a text range.
Public fieldStatic memberFontSizeAttributeIdentifies the FontSize attribute of a text range.
Public fieldStatic memberFontWeightAttributeIdentifies the FontWeight attribute of a text range.
Public fieldStatic memberForegroundColorAttributeIdentifies the ForegroundColor (COLORREF) attribute of a text range.
Public fieldStatic memberHorizontalTextAlignmentAttributeIdentifies the HorizontalTextAlignment attribute of a text range.
Public fieldStatic memberIndentationFirstLineAttributeIdentifies the IndentationFirstLine (TextIndent) attribute of a text range.
Public fieldStatic memberIndentationLeadingAttributeIdentifies the IndentationLeading(TextIndent) attribute of a text range.
Public fieldStatic memberIndentationTrailingAttributeIdentifies the IndentationTrailing(TextIndent) attribute of a text range.
Public fieldStatic memberIsHiddenAttributeIdentifies the IsHidden attribute of a text range.
Public fieldStatic memberIsItalicAttributeIdentifies the IsItalic (FontStyle) attribute of a text range.
Public fieldStatic memberIsReadOnlyAttributeIdentifies the IsReadOnly attribute of a text range.
Public fieldStatic memberIsSubscriptAttributeIdentifies the IsSubscript (FontVariants) attribute of a text range.
Public fieldStatic memberIsSuperscriptAttributeIdentifies the IsSuperscript (FontVariants) attribute of a text range.
Public fieldStatic memberMarginBottomAttributeIdentifies the MarginBottom (PageSettings) attribute of a text range.
Public fieldStatic memberMarginLeadingAttributeIdentifies the MarginLeading (PageSettings) attribute of a text range.
Public fieldStatic memberMarginTopAttributeIdentifies the MarginTop (PageSettings) attribute of a text range.
Public fieldStatic memberMarginTrailingAttributeIdentifies the MarginTrailing (PageSettings) attribute of a text range.
Public fieldStatic memberMixedAttributeValueIdentifies whether the value of a given attribute varies over a text range in a rich edit control.
Public fieldStatic memberOutlineStylesAttributeIdentifies the OutlineStyles (OutlineStyles) attribute of a text range.
Public fieldStatic memberOverlineColorAttributeIdentifies the OverlineColor attribute of a text range.
Public fieldStatic memberOverlineStyleAttributeIdentifies the OverlineStyle (TextDecorationLineStyle) attribute of a text range.
Public fieldStatic memberPatternIdentifies the TextPattern pattern.
Public fieldStatic memberStrikethroughColorAttributeIdentifies the StrikethroughColor attribute of a text range.
Public fieldStatic memberStrikethroughStyleAttributeIdentifies the StrikethroughStyle (TextDecorationLineStyle) attribute of a text range.
Public fieldStatic memberTabsAttributeIdentifies the Tabs attribute of a text range.
Public fieldStatic memberTextChangedEventIdentifies the event raised whenever textual content is modified.
Public fieldStatic memberTextFlowDirectionsAttributeIdentifies the TextFlowDirections (FlowDirections) attribute of a text range.
Public fieldStatic memberTextSelectionChangedEventIdentifies the event raised when the text selection is modified.
Public fieldStatic memberUnderlineColorAttributeIdentifies the UnderlineColor attribute of a text range.
Public fieldStatic memberUnderlineStyleAttributeIdentifies the UnderlineStyle (TextDecorationLineStyle) attribute of a text range.
Top

The TextPattern class may not provide for text features that exist only in a particular UI Automation provider. For these unique and often advanced features, the AutomationElement class provides methods for a UI Automation client to access the corresponding native object model.

.NET Framework

Supported in: 4.5.1, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows Phone 8.1, Windows Phone 8, Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.