Rich Text Box for SQL data

CNC_Man

Member
Joined
Dec 5, 2009
Messages
16
Programming Experience
Beginner
I have a quick question about WinForms text boxes interacting with SQL Data.
Is it possible to have rich text inside a text box that displays data from a database?
I am talking about the ability to highlight text, change the font to bold, etc.
Thank you!
 

Attachments

  • Untitled.png
    Untitled.png
    5.1 KB · Views: 58
RTF is like HTML in that it is just plain text that contains both data and markup. You can store that combined text in exactly the same way as you do any other text. In a RichTextBox control, you use the Rtf property to get and set that combined text while the Text property is for just the data, regardless of formatting.

So, if you want to store RTF in a database and display/edit it in your app then you can use a RichTextBox and bind the Rtf property in exactly the same way as you would the Text property of a regular TextBox.
 
Back
Top