Search Results for

    Show / Hide Table of Contents

    Class TextBox

    Inheritance
    System.Object
    ContentElement
    ParentElement
    BaseGraphicContainer
    Shape
    TextBox
    Implements
    ICloneableElement
    IParentElement
    IShape
    IGraphic
    ITextBox
    IContentElement
    IHasParagraphStyle
    Inherited Members
    Shape.Clone()
    Shape.Type
    Shape.Name
    Shape.FillColor
    Shape.OutlineColor
    Shape.Id
    BaseGraphicContainer.Resize(Int32, Int32)
    BaseGraphicContainer.Rotate(Double)
    BaseGraphicContainer.FlipHorizontal()
    BaseGraphicContainer.FlipVertical()
    BaseGraphicContainer.Height
    BaseGraphicContainer.Position
    BaseGraphicContainer.Width
    BaseGraphicContainer.Angle
    ParentElement.InsertChildToIndex(Int32, IContentElement[])
    ParentElement.Remove()
    ParentElement.RemoveChildren(IContentElement[])
    ParentElement.RemoveAllChildren()
    ParentElement.ExtractElements<T>()
    ParentElement.GetChildByIndex<T>(Int32)
    ParentElement.CloneElement<T>(T)
    ParentElement.LogObjectTree()
    ParentElement.Children
    ContentElement._Index
    ContentElement.Replace(IContentElement)
    ContentElement.GetIndex()
    ContentElement.CloneObject<T>(T)
    ContentElement.CaptureInitialValues()
    ContentElement.Index
    ContentElement.Parent
    ContentElement.Status
    Namespace: IronPPT.Models
    Assembly: IronPPT.dll
    Syntax
    public class TextBox : Shape, ICloneableElement, IParentElement, IShape, IGraphic, ITextBox, IContentElement, IHasParagraphStyle

    When a slide needs a bordered container that holds paragraphs of text, TextBox provides it. It is a shape that carries text, combining a shape's placement and styling with a text container's ability to hold and format multiple paragraphs, so a developer can lay out body copy, captions, and callouts as discrete blocks.

    A TextBox is created and added to a slide, then filled through its Add methods. Text content uses AddText (a string or an IText) and AddParagraph; nested graphics use AddShape and the four AddImage overloads (a path, a Stream, an AnyBitmap, or an existing IImage); and AddChild adds raw content elements. The text it holds is read back through the Paragraphs and Texts collection properties, each a List of the matching interface.

    Paragraph-level formatting for the whole box is set through Style, an IParagraphStyle that applies spacing and alignment across the box's paragraphs in one place rather than per paragraph. Because TextBox derives from Shape, it also carries the shape members for fill, outline, and geometry, so the same object positions itself on the slide and styles its border. That inheritance is what lets a caption sit in a bordered, filled frame and move as a single unit when the layout changes. Add the paragraphs first, then set Style for shared formatting, and reach for TextBox over loose text whenever the content should live in one movable, styleable frame.

    var textBox = new TextBox();
    textBox.AddParagraph(paragraph);
    textBox.AddText("Caption");
    slide.AddShape(textBox);

    The add text how-to places text on a slide, the add paragraph example builds the paragraphs a text box holds, and the paragraph style example styles them.

    Constructors

    TextBox()

    Declaration
    public TextBox()

    TextBox(ContentElement[])

    Declaration
    public TextBox(params ContentElement[] contents)
    Parameters
    Type Name Description
    ContentElement[] contents

    Properties

    Paragraphs

    Declaration
    public List<IParagraph> Paragraphs { get; }
    Property Value
    Type Description
    System.Collections.Generic.List<IParagraph>

    Style

    Declaration
    public IParagraphStyle Style { get; set; }
    Property Value
    Type Description
    IParagraphStyle

    Texts

    Declaration
    public List<IText> Texts { get; }
    Property Value
    Type Description
    System.Collections.Generic.List<IText>

    Methods

    AddChild(IContentElement[])

    Declaration
    public override void AddChild(params IContentElement[] children)
    Parameters
    Type Name Description
    IContentElement[] children
    Overrides
    ParentElement.AddChild(IContentElement[])

    AddImage(IImage)

    Declaration
    public IImage AddImage(IImage image)
    Parameters
    Type Name Description
    IImage image
    Returns
    Type Description
    IImage

    AddImage(AnyBitmap)

    Declaration
    public IImage AddImage(AnyBitmap anyBitmap)
    Parameters
    Type Name Description
    IronSoftware.Drawing.AnyBitmap anyBitmap
    Returns
    Type Description
    IImage

    AddImage(Stream)

    Declaration
    public IImage AddImage(Stream imageStream)
    Parameters
    Type Name Description
    System.IO.Stream imageStream
    Returns
    Type Description
    IImage

    AddImage(String)

    Declaration
    public IImage AddImage(string imagePath)
    Parameters
    Type Name Description
    System.String imagePath
    Returns
    Type Description
    IImage

    AddParagraph(IParagraph)

    Declaration
    public IParagraph AddParagraph(IParagraph paragraph)
    Parameters
    Type Name Description
    IParagraph paragraph
    Returns
    Type Description
    IParagraph

    AddShape(IShape)

    Declaration
    public IShape AddShape(IShape shape)
    Parameters
    Type Name Description
    IShape shape
    Returns
    Type Description
    IShape

    AddText(IText)

    Declaration
    public IText AddText(IText text)
    Parameters
    Type Name Description
    IText text
    Returns
    Type Description
    IText

    AddText(String)

    Declaration
    public IText AddText(string text)
    Parameters
    Type Name Description
    System.String text
    Returns
    Type Description
    IText

    Implements

    ICloneableElement
    IParentElement
    IShape
    IGraphic
    ITextBox
    IContentElement
    IHasParagraphStyle

    Inherited members

    Clone()
    Type
    Name
    FillColor
    OutlineColor
    Id
    Resize(Int32, Int32)
    Rotate(Double)
    FlipHorizontal()
    FlipVertical()
    Height
    Position
    Width
    Angle
    InsertChildToIndex(Int32, IContentElement[])
    Remove()
    RemoveChildren(IContentElement[])
    RemoveAllChildren()
    ExtractElements<T>()
    GetChildByIndex<T>(Int32)
    CloneElement<T>(T)
    LogObjectTree()
    Children
    _Index
    Replace(IContentElement)
    GetIndex()
    CloneObject<T>(T)
    CaptureInitialValues()
    Index
    Parent
    Status
    ☀
    ☾
    Downloads
    • Download with NuGet
    • Start for Free
    In This Article
    Back to top
    Install with NuGet