Search code examples
delphicanvasdelphi-7

delphi textrect wordwrap


I am using Canvas.TextRect in Delphi 7 to output something on the screen.

I need my text to be word wrapped in the rectangle.


Solution

  • You need to use DrawText (or DrawTextEx) with the DT_WORDBREAK flag.

    See the sample in this thread.