C1RichTextBox Task-Based Help > Setting the HTML Content |
The C1RichTextBox.Html property determines the HTML markup content of the C1RichTextBox control. By default the C1RichTextBox control starts blank and without content but you can customize this at design time, in XAML, and in code. Note that you can also set text as the control's content. See Setting the Text Content for details.
At Design Time
To set the C1RichTextBox.Html property, complete the following steps:
This will set the C1RichTextBox.Html property to the value you chose.
In XAML
For example, to set the C1RichTextBox.Html property addHtml="Hello World!" to the <c1rtb:C1RichTextBox> tag so that it appears similar to the following:
<c1rtb:C1RichTextBox HorizontalAlignment="Left" Margin="10,10,0,0" Name="C1RichTextBox1" VerticalAlignment="Top" c1:C1NagScreen.Nag="True" Height="83" Width="208" Html="<h1>Hello World!</h1>" />
In Code
For example, to set the C1RichTextBox.Html property add the following code to your project:
Visual Basic |
Copy Code
|
---|---|
Me.C1RichTextBox1.Html = "<h1>Hello World!</h1>" |
C# |
Copy Code
|
---|---|
this.c1RichTextBox1.Html = "<h1>Hello World!</h1>"; |
What You've Accomplished
You've set the text content of the C1RichTextBox control. Note that you had to represent angle brackets (< >) as "<" and ">". Run your application and observe that initially "Hello World!" (or the text you chose) will appear in the control in large text:
Note that you can also set text as the control's content. See Setting the Text Content for details. For an example of adding a hyperlink to the content of the C1RichTextBox control, see the Hyperlinks topic.