IsRtfText: Boolean;
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.
To execute the example a form, a button on this form named Button1, the TabSheetBox component and the UiTabSheet component named UiTabSheet1, which is the data source for TabSheetBox are required.
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.
The requirements and result of the Fore.NET Example execution match with those in the Fore Example. Use Fore.NET analogs instead of Fore components.
Imports Prognoz.Platform.Interop.ForeSystem;
Imports Prognoz.Platform.Interop.Tab;
Private Sub button1_Click(sender: System.Object; e: System.EventArgs);
Var
TSheet: ITabSheet;
TRange: ITabRange;
Converter: ITextConverter = New TextConverterClass();
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 := UiTabSheetNet1.TabSheetUi.TabSheet;
TRange := TSheet.ParseCell("A0");
TRange.IsRtfText := True;
TRange.Value := "Important text";
TRange.Text := Converter.Export(HTMLText, TextFormat.Rtf);
End Sub;
See also: