Word wrap in Delphi 7 implementation of TTreeview

Posted on 2005-04-12
Last Modified: 2010-08-05
Is it at all possible to wrap the node text in the standard TTreeview packaged with Delphi 7? If not is there any alternative solution that is perferably free :P
Question by:scandiumza
    LVL 27

    Expert Comment

    hmm, i would guess, it should be possible, if you draw the tree byself (ownerdraw-property, ondrawitem-event,...)

    but just a guess

    meikl ; -)

    Author Comment

    I tried looking at the custom drawing events but they dont allow you to change the individual node heights, also it doesnt give a rect which would indicate where the node is being drawn on the treeviews canvas. The only things i've been able to change is the font appearance.

    I found Michael's Virtual Treeview which is fantastic but is a bit too complex and would require alot of code changes in my project to implement and im pressed for time, its sad because the standard treeview can do everything I need except wrap the text :(
    LVL 27

    Expert Comment

    well, currently i have no delphi
    (thats why i post just from head in the past)

    maybe some other expert has a suggestion,
    which fits your need

    meikl ;-)
    LVL 26

    Accepted Solution


    Author Comment

    Although it was not 100% percent working code offered it gave me the clues which I required toa achieve the desired results, thanks Eddie :)

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
    Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

    730 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now