How to display multiple lines of text on a treenode in treeview?

How to display multiple lines of text on a treenode in treeview (using C# in
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

You can use <br /> to do that.

<asp:TreeNode Text="This is a<br /> Multiline text node" Value="This is a Multiline text node"></asp:TreeNode>
treehouse2008Author Commented:
I use treeview to display XML. If I insert <br /> into the text, <br /> is viewed as a XML node, then the real text is filtered out and is not displayed.
Try to encode < and > characters. Put #lt;br /#gt; (replace # to &)
CompTIA Security+

Learn the essential functions of CompTIA Security+, which establishes the core knowledge required of any cybersecurity role and leads professionals into intermediate-level cybersecurity jobs.

treehouse2008Author Commented:
I tried to put <br /> , the node is just displayed as <br />aaa<br />ccc<br />, not change lines.
treehouse2008Author Commented:

I tried to put  "#lt;br /#gt; (replace # to &)" , the node is just displayed as <br />aaa<br />ccc<br />, not change lines.
Wow, talk about over complicate things...... TreeView1.NodeWrap = true (is it == in C#? I'm using VB tbh).
Then the node will write on multiple lines but only stretch as far the width of the control.
treehouse2008Author Commented:
I did not find NodeWrap property in TreeView. Is there anything wrong with what I did?
treehouse2008Author Commented:
I'm using Windows Application. Not Web Application.
Sorry, been away for a while.....

Your question states how to wrap text on a treeview in Anyways, I'll add my answer as if you were writing a forms app.

If you're writing using forms, there is no wrap property in the default treeview, as you have stated. You may want to look at some Extended controls (controls people have adapted to add functionality), one that may assist can be found here:

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Tina karCommented:
I am finding solution for RADTreeview Text can be come in new line after certain size of Text .
Please give some solution
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.