Solved

Storing DATA and Format of the Rich Text Box

Posted on 2004-08-24
3
277 Views
Last Modified: 2010-04-23
Dear Experts

I am wokring in VB.net with SQL server2000

Is there any way to store the formatting styles say Forecolor/backcolor font type/font styles which is in the rich text box , i want to store the data of the richtext box in my SQLSERVER 2000 and again when i retrieve i want to get the same formatting styles back .
Or in other words i want to save the DATA of the RICH TEXT BOX  as well its Formatting styles

Is that possible ???

Please Guide Me
0
Comment
Question by:manishkaushik
3 Comments
 
LVL 85

Accepted Solution

by:
Mike Tomlinson earned 50 total points
ID: 11889334
The formatting of text in a RTB is stored as tags much like in HTML.  You can access the data in a RTB in two basic ways:

    Dim t As String
    t = RichTextBox1.Text() ' Retrieves only the text in the RTB

    Dim rtf As String
    rtf = RichTextBox1.Rtf ' Retrieves the text in the RTB along with all formatting information

So all you need to do is store the return of RichTextBox1.Rtf in your database.  To put the data along with its formatting back into the RTB you just set the string retrieved from your database back into the Rtf property:

    RichTextBox1.Rtf = rtf ' the string retrieved from your db that you placed there before

Regards,

Idle_Mind
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

912 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now