| Visual Basic (Declaration) | |
|---|---|
Public Property Html As String | |
| Visual Basic (Usage) | Copy Code |
|---|---|
| |
| C# | |
|---|---|
public string Html {get; set;} | |
Return Value
Valid hypertext with tags which will be rendered in the control.| C# | Copy Code |
|---|---|
private void reportHeader1_Format(object
sender, System.EventArgs e) | |
| Visual Basic | Copy Code |
|---|---|
Private Sub ReportHeader1_Format(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ReportHeader1.Format | |
You can bind a RichTextBox control to html in a database, but the text in the database must start with <HTML>. If the html in your database does not start with <HTML>, you can set the DataField property to ="<HTML>" + DataFieldName at design time, or set it at run time by using the following code:
private void Detail_Format(object sender, System.EventArgs eArgs){ this.RichTextBox1.Html = "\n" + this.RichTextBox1.Text;}