This is my first post, Hello to all. This also a test post to make sure that I am doing the right thing and following rules etc.
I have been searching for a way to make the treeview display multiple lines of text on each treeview node (treenode).
After searching for answers and not finding any, I stumbled on the solution in the msdn help files (search for TreeView.DrawNode Event). It has source code that shows how to display multiple lines of text for a single node.
You need to setup the treeview by changing the drawmode so that the text is draw by the _DrawNode event.
Expand|Select|Wrap|Line Numbers
- treeViewForTasks.DrawMode = TreeViewDrawMode.OwnerDrawText;
Expand|Select|Wrap|Line Numbers
- childNode.Text = tr.Name + Environment.NewLine + tr.Description + Environment.NewLine + Environment.NewLine + "Incomplete";
Expand|Select|Wrap|Line Numbers
- // Draw the node text.
- e.Graphics.DrawString(e.Node.Text, nodeFont, Brushes.White, Rectangle.Inflate(e.Bounds, 2, 0));