Re: EM_SCROLLCARET problem
From: Henry Bartlett (hambar_at_Spamlock.microtech.com.au)
Date: 05/06/04
- Next message: Colin Basterfield: "Re: Stack Size and Access Violations..."
- Previous message: Maarten Wiltink: "Re: Loop without escape"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 6 May 2004 13:13:27 +1000
Gery <gprdataNO@SPAMMMMMzip.com.au> wrote in message
news:1mj9809su6hh9221fgt0h66vmthoi1f8fv@4ax.com...
> I'm using RichEdit to display Div. length Text files.
"Div. length Div. length Text files"?
> As I want always to see the end of the files
> I,m using
> RE.Perform(EM_SCROLLCARET, 0, 0);
>
> It does put the cursor at the eof ok, but the eof is not alwise at
the
> bottom of the RE. If the file is shorter as the prev. one, no text
is
> visible, as the eof is then one line above of the top of RE.
>
> How can I fix this that the eof is at the bottom of RE ?
My Delphi may be a little rusty as I have been on holiday but here
goes anyway.
var I: integer;
begin
I := length (RE.Rext) - 1; // find the last character in RE
while RE.text[I] in [#10, #13] do
dec (I); // move back past any terminating CRLFs
RE.selstart := I; // set your caret on the last non-empty line
RE.Perform(EM_SCROLLCARET, 0, 0); // now bring your caret int view
end;
// NOT TESTED
-- Henry Bartlett HABit utilities ( http://www.hotkey.net.au/~hambar/habit/ ) email: hambar@Spamlock.microtech.com.au. Please remove the "Spamlock." from my address when replying. > Hi to all and thanks for any replay's. > > I'm using RichEdit to display Div. length Text files. > As I want always to see the end of the files > I,m using > RE.Perform(EM_SCROLLCARET, 0, 0); > > It does put the cursor at the eof ok, but the eof is not alwise at the > bottom of the RE. If the file is shorter as the prev. one, no text is > visible, as the eof is then one line above of the top of RE. > > How can I fix this that the eof is at the bottom of RE ? > > > > Regards Gery > > Tanks for any replay
- Next message: Colin Basterfield: "Re: Stack Size and Access Violations..."
- Previous message: Maarten Wiltink: "Re: Loop without escape"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|