Board index » delphi » RichEdit - Indent

RichEdit - Indent

Gentlemen
  Objective is to have a selected text be indented x number of spaces and
wrap to the next line begining x number of spaces indented.  (i.e.
On line 22 of a report, have the following text begin in Column 45 and
should the text be more than Quick Report allow, wrap the text onto the next
line but beginning in column 45.  After the printing of the text, which may
end up on line 29, Reset teh Tab Column to Column #1.

Any Suggestions?
Thanks
Ron Spahr
ron_sp...@mhcs.org

 

Re:RichEdit - Indent


I have spin button linked to edit control to indent user-selected text.

procedure TfmMolba.Edit11Change(Sender: TObject);
begin
DBRichEdit1.Paragraph.LeftIndent := StrToInt(Edit11.Text);
end;

Measurment is in pixels. It enables finer positioning than with spaces.
(If you want to select text by code than use .SelStart and .SelLength)
There is also RightIndent.

That way, only current paragraph (selected text) will be affected.
Sometimes, if text is not "moving", user needs to press TAB while on
begining of line. While user does so, RichEdit will word-wrap text,
following new identation. (if wordwrap is set to true)

I solved the problem of word wrapping by QR (which produces text that does
not match one in RichEdit) using same Width property both for RichEdit and
QRMemo.

Hope that this helps a bit.

Ron Spahr <ron_sp...@mhcs.org> wrote in article
<6udegv$3t...@forums.borland.com>...

Quote
> Gentlemen
>   Objective is to have a selected text be indented x number of spaces and
> wrap to the next line begining x number of spaces indented.  (i.e.
> On line 22 of a report, have the following text begin in Column 45 and
> should the text be more than Quick Report allow, wrap the text onto the
next
> line but beginning in column 45.  After the printing of the text, which
may
> end up on line 29, Reset teh Tab Column to Column #1.

> Any Suggestions?
> Thanks
> Ron Spahr
> ron_sp...@mhcs.org

Other Threads