Convert Text to RichText

Posted on 2005-05-11
Medium Priority
Last Modified: 2010-05-18
Anyone have an idea of how to convert Text to RichText? I'm using the VB.Net RichText control to display and save Text in a SQL Server Database. The text needs to be converted and saved as RichText.  Right now, I set the RichTextBox control to the value from the Database but it doesn't display becuase it doesn't have the RTF markup codes.
Question by:onyak
  • 2
LVL 25

Expert Comment

ID: 13978880

Author Comment

ID: 13979189
It's nvarchar.  And it's stored as Text and RichText.  What I need to do is...over time...has the application automatically convert all text to RichText by converting the text to Richtext in the application....unless it's already richtext.

The link you posted did not have the solution.

Author Comment

ID: 13980073
Found a solution, but it's not the best solution...

                        rtb.Rtf = rt
                        rtb.Rtf = "{\rtf1\ansi\ansicpg1252\deff0\deflang1033" & _
                                "{\fonttbl{\f0\fnil\fcharset0 Microsoft Sans Serif;}}\viewkind4\uc1\" & _
                                "pard\f0\fs17 " & rt.ToString & "\par}"
                    End Try

Accepted Solution

PAQ_Man earned 0 total points
ID: 14255552
PAQed with points refunded (500)

Community Support Moderator

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
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 .
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
Suggested Courses

839 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