Delphi7 Canvas.TextOut can't write new lines
问题 I am trying to replace all "#" with new lines to draw: Canvas.TextOut(0,0,''+StringReplace('a#b','#',#13#10,[rfReplaceAll])); but nothing. TextOut prints "a#b" like the the replaced part doesn't even exist (But it does exist ofcourse): ab Instead of this: a b #13#10 is the new line (Windows) right? Then why this isn't working? Thank you. 回答1: You need to use DrawText to produce multi-line text: var R: TRect; .... R := Rect(0, 0, Width, Height); DrawText( Canvas.Handle, PChar(StringReplace('a