Interface ITextBox
Assembly: IronPPT.dll
Syntax
public interface ITextBox : IContentElement, IHasParagraphStyle
When a slide needs a box that holds words and other content, ITextBox is the contract for it. It represents a text box placed on a slide and gives a developer one surface for filling that box with text, paragraphs, images, and shapes, then reading those contents back, so building a captioned panel or a bulleted callout goes through a single object.
A developer receives an ITextBox rather than constructing it directly: ISlide.TextBoxes is a List<ITextBox>, and TextBox is the concrete implementor, a Shape that also carries text. Because a text box is a kind of shape, it brings the shape contract along with the text-box members, so the same object can be moved and recolored as a shape and filled with content as a text box. That dual nature is why a caption panel and the box behind it are one object, not two.
The add methods build the box up: AddText accepts a string or an IText, AddParagraph takes an IParagraph, AddImage has overloads for a path, a Stream, an AnyBitmap, or an IImage, AddShape adds an IShape, and AddChild attaches several IContentElement items at once. The two collections read the box back: Texts is a List<IText> and Paragraphs is a List<IParagraph>. The default paragraph formatting for the box comes through the Style member inherited from IHasParagraphStyle, so text added to the box picks up a consistent look.
ITextBox box = slide.TextBoxes[0];
box.AddText("Caption");
box.AddParagraph(paragraph);
The add text how-to places text on a slide, the add paragraph example builds paragraphs, and the slide element tutorial covers slide elements.
Properties
Paragraphs
Declaration
List<IParagraph> Paragraphs { get; }
Property Value
| Type |
Description |
| System.Collections.Generic.List<IParagraph> |
|
Texts
Declaration
List<IText> Texts { get; }
Property Value
| Type |
Description |
| System.Collections.Generic.List<IText> |
|
Methods
AddChild(IContentElement[])
Declaration
void AddChild(params IContentElement[] children)
Parameters
AddImage(IImage)
Declaration
IImage AddImage(IImage image)
Parameters
| Type |
Name |
Description |
| IImage |
image |
|
Returns
AddImage(AnyBitmap)
Declaration
IImage AddImage(AnyBitmap anyBitmap)
Parameters
| Type |
Name |
Description |
| IronSoftware.Drawing.AnyBitmap |
anyBitmap |
|
Returns
AddImage(Stream)
Declaration
IImage AddImage(Stream imageStream)
Parameters
| Type |
Name |
Description |
| System.IO.Stream |
imageStream |
|
Returns
AddImage(String)
Declaration
IImage AddImage(string imagePath)
Parameters
| Type |
Name |
Description |
| System.String |
imagePath |
|
Returns
AddParagraph(IParagraph)
Declaration
IParagraph AddParagraph(IParagraph paragraph)
Parameters
Returns
AddShape(IShape)
Declaration
IShape AddShape(IShape shape)
Parameters
| Type |
Name |
Description |
| IShape |
shape |
|
Returns
AddText(IText)
Declaration
IText AddText(IText text)
Parameters
| Type |
Name |
Description |
| IText |
text |
|
Returns
AddText(String)
Declaration
IText AddText(string text)
Parameters
| Type |
Name |
Description |
| System.String |
text |
|
Returns