GemBox.Presentation
  • Overview
  • Examples
  • Free version
  • Support
  • Pricelist

    Show / Hide Table of Contents

    TextElement Class

    Namespace:
    GemBox.Presentation
    Assembly:
    GemBox.Presentation.dll

    Represents a base class for text elements such as runs, fields, line breaks and unknown text elements.

    • C#
    • VB.NET
    public abstract class TextElement
    Public MustInherit Class TextElement
    Inheritance:
    System.Object
    TextElement
    Derived
    TextField
    TextLineBreak
    TextRun
    TextUnknown

    Properties

    ElementType

    Gets the type of the text element.

    • C#
    • VB.NET
    public abstract TextElementType ElementType { get; }
    Public MustOverride ReadOnly Property ElementType As TextElementType
    Property Value
    TextElementType

    The type of the text element.

    Format

    Gets or sets the character formatting options.

    • C#
    • VB.NET
    public TextCharacterFormat Format { get; set; }
    Public Property Format As TextCharacterFormat
    Property Value
    TextCharacterFormat

    The character formatting options.

    Remarks

    This property always returns a new instance of a TextCharacterFormat that points to data associated with this text element. This reduces memory footprint since simpler internal structures can be used to hold the data and execution time increase is negligible since Garbage Collector has a very good performance for a short-lived (Generation 0) objects.

    When setting a value, instance of a TextCharacterFormat won't actually be stored in this text element, but the data to which the instance points to will be copied. This enables easy copying of complex properties from one text element to another.

    Parent

    Gets the parent text paragraph or null if text element was deleted.

    • C#
    • VB.NET
    public TextParagraph Parent { get; }
    Public ReadOnly Property Parent As TextParagraph
    Property Value
    TextParagraph

    The parent text paragraph or null if text element was deleted.

    Slide

    Gets the slide associated with this text element.

    • C#
    • VB.NET
    public SlideObject Slide { get; }
    Public ReadOnly Property Slide As SlideObject
    Property Value
    SlideObject

    The slide associated with this text element.

    TextContent

    Gets the text content of the current TextElement.

    • C#
    • VB.NET
    public TextRange TextContent { get; }
    Public ReadOnly Property TextContent As TextRange
    Property Value
    TextRange

    The text content of the current TextElement.

    Remarks

    The property always returns a new instance of the TextRange class.

    For more information, see Find and Replace example.

    Methods

    ToString()

    Returns a System.String that represents this TextElement instance.

    • C#
    • VB.NET
    public abstract override string ToString()
    Public MustOverride Overrides Function ToString As String
    Returns
    System.String

    A System.String that represents this TextElement instance.

    Overrides
    System.Object.ToString()

    Examples

    Character Formatting Example
    Find and Replace example
    Back to top

    Facebook • Twitter • LinkedIn

    © GemBox Ltd. — All rights reserved.