[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Storing DATA and Format of the Rich Text Box

Posted on 2004-08-24
3
Medium Priority
?
287 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
1 Comment
 
LVL 86

Accepted Solution

by:
Mike Tomlinson earned 200 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Screencast - Getting to Know the Pipeline
Suggested Courses

810 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