Table of Contents

TDrawingRichString Record

A rich string used in drawings. It is similar to TRichString but it has more properties like for example wordart properties. Similar to a string, this class is immutable.

Syntax

Unit: FlexCel.Core

TDrawingRichString = record;

Methods

Name Description
Create Overloaded
Create
Create(string)
Create(TDrawingTextParagraphArray)
Create(string, TDrawingAlignment)
Paragraph A paragraph of the text.
Substring Overloaded
Substring(Integer)
Substring(Integer, Integer)
Add Adds two richstrings together. If using C#, you can just use the overloaded "+" operator to contactenate rich strings.
Trim Trims all the whitespace at the beginning and end of the string.
RightTrim Trims all the whitespace at the end of the string.
ToString Returns the string without Rich text info.
HasFields Returns true if the TDrawingRichString has any fields that must be replaced by values.
ToRichString Overloaded
ToRichString(TCoreExcelFile, IShapeFont)
ToRichString(TCoreExcelFile, IShapeFont, TFlxFont)
ToRichString(TCoreExcelFile, IShapeFont, TFlxFont, TFunc<string, TRichString>)
ToRichString(TCoreExcelFile, IShapeFont, TFlxFont, TFunc<string, TRichString>, Boolean)
FirstRun Returns the first run of the text. Note that an empty TDrawingRichText can have a run anyway, while a TRichString can't.
If there is no first run, the returned value will have a a negative FirstChar.
FromRichString Overloaded
FromRichString(TRichString, TCoreExcelFile, TDrawingAlignment)
FromRichString(TRichString, TCoreExcelFile, TDrawingRichString, TDrawingAlignment)
FromRichString(TRichString, TCoreExcelFile, TDrawingRichString, TDrawingAlignment, Boolean)
ReplaceText Replaces the existing text in this struct with the text in rs, keeping the properties of the text.
GetTextProperties Modifies a TDrawingText​Properties by adding the settings from a TFxFont.
CompareTo Returns -1 if obj is bigger than this, 0 if both strings are the same, and 1 if obj is smaller than this.
GetHashCode Returns the hashcode of the object.
Equals Returns true if both instances have the same string and formatting.
DrawingHAlign​From​Align Converts a horizontal alignment from Excel alignment to Drawing alignment.
ReplaceParagraph Returns a new rich string with one paragraph of the original rich string replaced.
WithNewFieldIds Returns a new TDrawingRichString with new field ids if the DrawingRichString has field ids.
While FlexCel will do this automatically when you link a shape, you can use this method when creating a new linked shape that requires new field ids.
IsNull Returns true if the record doesn't have a defined value.
HasValue Returns true if the record has a defined value. This is the inverse of IsNull

Operators

Name Description
Equality Adapts the = operator so it returns true when both instances have the same values.
Inequality Adapts the <> operator so it returns true when both instances have different values.
Addition Adapts the + operator so it can add two instances of this record.
Implicit Conversion Overloaded
Implicit conversion from string to TDrawingRichString
Implicit conversion from TDrawingRichString to string
LessThan Adapts the < operator so it returns true when the first parameter is smaller than the second.
GreaterThan Adapts the > operator so it returns true when the first parameter is bigger than the second.

Properties

Name Description
Value Text of the string without formatting. Might be null.
ParagraphCount The count of Paragraphs in this string.
Length Length of the DrawingRichString.
IsEmpty Returns true if the string has no data.