1
Reply

To Show XML File Inside RichTextBox With updation of text capability after clicking a button.

Adarsh Pandey

Adarsh Pandey

Feb 19 2010 11:20 PM
6.4k
hi to all,

          I am having one Problem in update in RTB Control.
Description is as follows:
I am reading a XML File and Showing It inside a RTB Control. When I am Inserting the Text in RTB at the same time I am Changing the Text color of the Text so that It displays diffrent tags of XML in different color.

Requirement:
If I select a text and click on bold Button (Which I created for In RTB to make font Bold). The text is displaying in Bold. But my Requirement is whenever I click on Bold It has to Insert this Text In place of Selected Text i.e.( <b>SelectedText</b>.)
for this I Wrote This Code :
RichTextBox1.SelectedText = "<b>" + RichTextBox1.SelectedText + "</b>";

It is Working Fine But I am having such a requirement like this when I again click on this Bold button these tags (<b> and </b>) must removed from the selected text.
for this what I have to write????

Please help me on this issue. Its very urgent.

If requirement is not clear Please let me know..

Thanks in Adavance.



Answers (1)