Board index » delphi » WordWrap TRichEdit

WordWrap TRichEdit

How can I wordwrap a TRichEdit control at a specified number of characters?
 So, when the user types the lines wrap at a user defined wordwrap of say,
50 characters, or whatever.

Thanks.
-------
Scott Jarkoff
Schizofrenia!
alt...@mindless.com
alt...@surfline.ne.jp
http://www.surfline.ne.jp/alt-fx
-----
(c) 1997, Schizofrenia! ( Signature generated w/SchizoSigz! v.50 )
Get your copy at: http://www.surfline.ne.jp/alt-fx

 

Re:WordWrap TRichEdit


Scott Jarkoff <alt...@mindless.com> D?? ???
<5l6c0t$...@pecan.surfline.ne.jp>...

Quote
> How can I wordwrap a TRichEdit control at a specified number of
characters?
>  So, when the user types the lines wrap at a user defined wordwrap of
say,
> 50 characters, or whatever.

.OnKeyPress
        LineNum := Perform(EM_LINEFROMCHAR, SelStart, 0);
        LineStart := Perform(EM_LINEINDEX, LineNum, 0);
        X := SelStart-LineStart;
        if (Key{is not arrows, etc}) and (X > 50) then SelText := ^M^J;

After that the key pressed will be inserted, but on the next line.

--
Alexander Petrosyan, Moscow.
email: p...@fbit.msk.su
phone: +7(095)535-2222

Other Threads