Board index » delphi » RichEdit - setting tab stops
Ivan Prenosil
![]() Delphi Developer |
Sat, 15 Jun 2002 03:00:00 GMT
RichEdit - setting tab stops
I need to set tab stops in RichEdit so that text written in Courier font
will be properly aligned, regardless I use spaces or tabulators. i.e. these two strings should look identically: RichEdit.Lines.Append('abc def ghi'); RichEdit.Lines.Append('abc'#9'def'#9'ghi'); The problem is how to compute tab positions in pixels. Because Canvas has method TextWidth, pb := TPaintBox.Create(RichEdit); But the tab_width is too large. tab_width := pb.Canvas.TextWidth('123456'); the size is exactly what I need, but I do not understand WHY ? -- |