Rich Text Box and Hyperlinks
-
In a C# application I have created a rich text box (let's say richTextBox1) whose contents are saved to an XML file. Later I retrieve the text from XML file and display it in another rich text (let's say richTextBox2). If the text that I paste in richTextBox1 contains hyperlink associated to it then the url is displayed next to the word that initially contained hyperlink. Because of this when I retrieve the text in richTextBox2 it displays an url next to the word. It's too messy. Is there any way I can save and retrieve the hyperlink as in richTextBox1 and richTextBox2. e.g. If I copy the below statement to paste in richTextBox1 "Click here for Hotmail" <-- note: Hotmail is the hyperlink. If I paste the above text to richTextBox1 it gets pasted as below "Click here for Hotmail " In richTextBox2 it retrives as "Click here for Hotmail " I want it to display as "Click here for Hotmail" <-- note: with Hotmail as the hyperlink. Is there a way to do it? thanks ---------- Venus Patel http://patelsinc.blogspot.com/ A student knows little about a lot. A professor knows a lot about little. I know everything about nothing.
-
In a C# application I have created a rich text box (let's say richTextBox1) whose contents are saved to an XML file. Later I retrieve the text from XML file and display it in another rich text (let's say richTextBox2). If the text that I paste in richTextBox1 contains hyperlink associated to it then the url is displayed next to the word that initially contained hyperlink. Because of this when I retrieve the text in richTextBox2 it displays an url next to the word. It's too messy. Is there any way I can save and retrieve the hyperlink as in richTextBox1 and richTextBox2. e.g. If I copy the below statement to paste in richTextBox1 "Click here for Hotmail" <-- note: Hotmail is the hyperlink. If I paste the above text to richTextBox1 it gets pasted as below "Click here for Hotmail " In richTextBox2 it retrives as "Click here for Hotmail " I want it to display as "Click here for Hotmail" <-- note: with Hotmail as the hyperlink. Is there a way to do it? thanks ---------- Venus Patel http://patelsinc.blogspot.com/ A student knows little about a lot. A professor knows a lot about little. I know everything about nothing.
Have a look at this article.