IsRtfText: Boolean;
The IsRtfText property determines whether formatting and text are stored in RTF format.
Available values:
True. Individual formatting can be set for separate text parts. Text and formatting are stored in RTF format.
False. Font settings defined in the ITabCellStyle.Font property will be applied to the text.
To get or modify a text in RTF format, use the ITabRange.Text property. As special values of RTF format specification are required to present text in this format, the TextConverter special class was implemented in Fore to facilitate working with this format. Methods of this class allow to convert and get RTF view from more usable formats, such as XAML, HTML.
Executing the example requires a form with the Button1 button located on it, the TabSheetBox component and the UiTabSheet component named UiTabSheet1 that is used as a data source for TabSheetBox.
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
TSheet: ITabSheet;
TRange: ITabRange;
Converter: ITextConverter;
HTMLtext: String = "<span style=""font-size: 8pt;color: #000000;text-align: left;font-family: Arial; "">" +
"<span style=""color: #ff0000;font-size: 10pt;font-family: inherit;"">Important </span>" +
"<span style=""color: #0000ff;font-style: italic;font-size: 8pt;font-family: inherit;"">text</span></span>";
Begin
TSheet := UiTabSheet1.TabSheet;
TRange := TSheet.ParseCell("A0");
TRange.IsRtfText := True;
Converter := New TextConverter.Create;
TRange.Value := "Important text";
TRange.Text := Converter.Export(HTMLText, TextFormat.Rtf);
End Sub Button1OnClick;
Clicking the button sets formatted text for the A0 cell. The text is set by converting from HTML to RTF format.
See also: