Settings of RichTextBox Control for C# Windows Forms
KetticRichTextBox control for Windows Forms is capable of the import and export of documents in various formats, including rtf, html, xaml, docx, plain text and pdf. To set the contents of the documents, we should clear the format of the data in the document. KetticRichTextBox control contains various format providers for the users to deal with the import and export of the documents. Additionally, this controls also allows the users to set the margins of a documents.
Get and Set the Text of KetticRichTextBox
To get and set the text of KetticRichTextBox control, we can use the format providers and assemblies included in the component listed as below.
To get the content of the document in a specific format, we shall create an instance of the corresponding provider and export the document. The C# code below shows how to export an plain text file.
We can also use the same way to set the content of KetticRichTextBox when the content is in one of the formats. The C# code below demonstrates how to import an html string in the document of KetticRichTextBox.
KetticRichTextBox control provides the Insert methods for KetticDocument and KetticRichTextBox to save the initial document content and insert text at different positions in the document. The Insert method applies the current span style of the document and the KetticDocument method allows the users to create a StyleDefinition and fill it up with the property values of the text. The following are the C# code examples.
C# Insert Text in KetticRichTextBox at Caret Position
C# Insert Text in a Custom Style using method of KetticDocument
C# Insert Text in Current Editing Style of the RichTextBox
C# Set Margins of the Document
UI Controlsfor Windows Forms.NET WinForms UI Overview.NET WinForms UI Features.NET WinForms UI GuideC# WinForms UI DesignVB.NET WinForms UI Design
WinForms UI Controls