Tree View - Word Wrap

SANCHIT SHARMA

Active member
Joined
Jul 15, 2005
Messages
38
Programming Experience
10+
HI,

NEED HELP IN CONTROLLING THE DISPLAY OF TEXT IN A WRAP MODE ON TREEVIEW NODE

AAA
BBB
CCCCCCCCCCCCCCCCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCCCCCCCC
 
Question Elaborated

Dear Jmcilhiney,

Thanks for taking pain and responding on this question. Actually the detailed problem is as follows

I created a tree control
Parent ---- Child ----- sub Child

This tree is working efficiently. But the bottle neck is , when i display Node Text of higher length it display it as a single line, instead of wrapping it within the bounds of Tree control.

The pictorial presentation is as follows

Parent ---- aaa
Child -------bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb

Here it shows the node text in single line. If someone wants to see the entire content either he has to scroll or see the tool tip text for the refrence.

I want it to be

Parent -----aaa
Child ------bbbbbbbbbbbbbbbbbbbbbb
Child cont.-bbbbbbbbbbbbbbbbbbbbbb
Child cont.-bbbbbbbbbbbbbbb

Here the text is getting displayed at the node position in a wordwrap form.


How to achieve this pls suggest and help.


Regards
 
If the TreeView or the TreeNode don't have a property you can specifically set for that, which I doubt, then you'd have to handle drawing the node yourself. It makes sense that this is not automatic because what if the text of a node is completely outside the TreeView control? How would you wrap that?
 
Do you have any code to see? You should set a CONST MAX_LENGTH and if your entries pass that then split them and add a new child node.
 
Back
Top