Rich Text Box

B

Big E

I'm using VB.net and SQL server 2000. I have a Windows form that has a Rich
Text Box on it. I also have a Font Dialog Box that changes the font and size
in the Rich Text box. When I do a normal update to the database the font
info is not included.

How do I save font information to a database.

Thank you,

E
 
H

Herfried K. Wagner [MVP]

* "Big E said:
I'm using VB.net and SQL server 2000. I have a Windows form that has a Rich
Text Box on it. I also have a Font Dialog Box that changes the font and size
in the Rich Text box. When I do a normal update to the database the font
info is not included.

How do I save font information to a database.

Save the value of the control's 'Rtf' property.
 
B

Big E

Thanks. I got it to work.
Now that it is saved in the database as
{\rtf1\ansi\deff0{\fonttbl{\f0\fnil\fcharset0 Microsoft Sans Serif;}}
how do I retrieve just the text back out to a form without the .rtf stuff.

Thanks.

E
 
H

Herfried K. Wagner [MVP]

* "Big E said:
Thanks. I got it to work.
Now that it is saved in the database as
{\rtf1\ansi\deff0{\fonttbl{\f0\fnil\fcharset0 Microsoft Sans Serif;}}
how do I retrieve just the text back out to a form without the .rtf stuff.

Mhm... I don't have an idea (maybe it works with regular expressions,
but I don't have any regular expressions to do that). The easiest way
is to store the plain text too.
 
B

Brian Davis

If you are retrieving it with .NET code, you can just create a RichTextBox,
set its RTF property to the RTF from Database, then access the RichTextBox's
Text property.


Brian Davis
www.knowdotnet.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top