Solved

Storing DATA and Format of the Rich Text Box

Posted on 2004-08-24
3
275 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
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

771 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

12 Experts available now in Live!

Get 1:1 Help Now