Click here to Skip to main content
15,886,795 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Inside a form I have a multiline textBox, in that textBox I have simply text, like this:

<VideoCard><brand id = '34' another = 'A'>PNY</brand><brand id = '43' other = 'B'>Gigabyte</brand></VideoCard>


and when I press a button, the text inside the first textBox will show in another textBox like this (with the identation and all that):

XML
<VideoCard>
      <brand id = '34' another = 'A'>PNY</brand>
      <brand id = '43' other = 'B'>Gigabyte</brand>
</VideoCard>


How can I archieve that?

Note: I can't use LINQ
Posted

1 solution

You could do this using a richtextbox.
Try Displaying and Filtering XML Data with WinForms in C#[^

You could display indentation even in a textbox. However, you need to provide the indentation logic yourself.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900