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.
You need to use DrawText (or DrawTextEx) with the DT_WORDBREAK flag.
See the sample in this thread.
Use
DrawText( hdc, pchar(s), length(s), rcRect, DT_NOPREFIX or DT_WORDBREAK);
where
s
: string to print
rcRect
: TRect the rect wherein the string should be printed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With