I’m working on an application with a co-worker at the moment – she is writing a web form that allows users to enter and manage text that will be saved to the database and then displayed within a desktop application.
I’m using a Rich Text Box to display the text from the database. We want to allow the users to use basic formatting (bold, italic, underline) in the web app, and then display that formatting in the desktop app.
I’m wondering if there is a tag or something that can be entered into the web form (like or [b] etc), that will automatically display the formatting within the RTB.
If that isn’t possible, what will be the best way to achieve this functionality?
I’m using C# windows form for the desktop application.
Update:
The web form is in PHP.
I played around with this a few years back – basically I had text in a database that I was marking up to emphasize certain words. I marked it up in a stored procedure, and then translated that to RTF on the client side.
I tried looking into the RTF spec, but it’s somewhat challenging to just read the spec and know what to do.
I suggest popping open Wordpad (Start -> Run… -> wordpad), and mess around with different font styles and such. Then save it off as an RTF document somewhere. Open up that document in a plain-text editor of your choice (I use Notepad++), and that’ll help you figure out RTF a lot easier.
Here’s an example of a simple RTF document I created:
Some of those tags are just extra markup that you can probably do without. Play around with it and see.
Eventually you should be able to do something along the lines of: