Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Storing DATA and Format of the Rich Text Box

Posted on 2004-08-24
3
Medium Priority
?
285 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…

636 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