Need help in wrapping text around Selected Text
Hi programmers,
I am Titus Cheng. I am facing a problem that I don't know how to solve.
I have two rich text box control. One for editing visually, another is for add tags, like a wysiwyg text editor.
I want to wrap tags around selectedtext.
For example, if I selected the text "glass" in "I am drinking the glass of milk" and change the fontstyle to bold,
it will appear something like "I am drinking the [bold]glass[/bold] of milk".
and If I want to change the text to red, it will appear like
"I am drinking the [bold][red]glass[/red][/bold] of milk"
Can anyone help me with this problem?
I am not trying to change the tags to html code, but rather contextual tags.
Scott LyslePosted Mar 24, 2007, 2:48 PM
The rich text box control allows you to develop controls on top of that will allow you do select and bold the text, or put it into italics, or underline it, or change its color. You need not manually apply tags to do that.
If you look at an RTF document in notepad; you will find that these tags are already there but not visible if the document is opened in Word or and RTF editor like wordpad.
If you want to know more about using the rich text box control, take a look at this:
http://www.c-sharpcorner.com/UploadFile/scottlysle/WordProcessor02042007234628PM/WordProcessor.aspx?ArticleID=28d83287-c96b-420c-b608-d714fbd0f8c5