Home All Groups Group Topic Archive Search About

TreeView text nodes wordwrap

Author
23 Nov 2004 8:35 AM
fuul
I am looking for a way to make the TreeView's nodes wrap instead of forcing
horizontal scrolling (or find a custom TreeView control that someone else has
already tweaked.)

If no one knows where I can find such a version, do you think it is worth a
try at overloading the class and customizing the way the nodes are drawn? Is
that even possible? If so, could someone give me a link to an example of
someone customizing the way a control is drawn?

Thank you all very much...

fuul
treeviewquest***@smithlings.com

Author
23 Nov 2004 8:46 PM
RBischoff
Hello fuul,
Yes it is possible. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwinforms/html/custcntrlsamp4.asp

Best of luck!

Your C# ally ,
RBischoff


f> I am looking for a way to make the TreeView's nodes wrap instead of
f> forcing  horizontal scrolling (or find a custom TreeView control that
f> someone else has  already tweaked.)
f>
f> If no one knows where I can find such a version, do you think it is
f> worth a  try at overloading the class and customizing the way the
f> nodes are drawn? Is  that even possible? If so, could someone give me
f> a link to an example of  someone customizing the way a control is
f> drawn?
f>
f> Thank you all very much...
f>
f> fuul
f> treeviewquest***@smithlings.com
Author
24 Nov 2004 8:45 AM
fuul
Thank you, that is a great reference.

I was hoping that each Node would have its own Paint method that I could
override (each one called by the main Paint routine in sequence) so that I
could just alter each Node's "top" property before it was drawn,
re-positioning it below the space taken by the wrapped nodes above it.

However, it looks like the TreeView just has one Paint method and if I
override it I will have to completely redraw the whole treeview myself... (am
I right about that?) That would be fine if I had the original code and I
could just tweak it, (I don't suppose Microsoft has released the code for
it...) Anyone have code lying around for rendering a hierarchical TreeView?



Show quote
"RBischoff" wrote:

> Hello fuul,
>  Yes it is possible. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwinforms/html/custcntrlsamp4.asp
>
> Best of luck!
>
> Your C# ally ,
> RBischoff
>
>
> f> I am looking for a way to make the TreeView's nodes wrap instead of
> f> forcing  horizontal scrolling (or find a custom TreeView control that
> f> someone else has  already tweaked.)
> f>
> f> If no one knows where I can find such a version, do you think it is
> f> worth a  try at overloading the class and customizing the way the
> f> nodes are drawn? Is  that even possible? If so, could someone give me
> f> a link to an example of  someone customizing the way a control is
> f> drawn?
> f>
> f> Thank you all very much...
> f>
> f> fuul
> f> treeviewquest***@smithlings.com
>
>

AddThis Social Bookmark Button