Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

"TMemo" : How to go to First Line?

3,712 views
Skip to first unread message

David Lau

unread,
Jul 16, 1998, 3:00:00 AM7/16/98
to
Hello,
When I add line(s) to a TMemo, the cursor is set to the bottom. So how
can I set the view to the first line ?

Thanks!

David ^_^

Rick Rogers (TeamB)

unread,
Jul 16, 1998, 3:00:00 AM7/16/98
to
On Thu, 16 Jul 1998 16:05:24 +0800, "David Lau" <david-...@usa.net>
wrote:

> When I add line(s) to a TMemo, the cursor is set to the bottom.

Memo1.SelStart := 0;
SendMessage(Memo1.Handle, EM_SCROLLCARET, 0, 0);

--
Rick Rogers (TeamB) | Fenestra Technologies
http://www.fenestra.com/

Errol Croy

unread,
Jul 16, 1998, 3:00:00 AM7/16/98
to

Hi David,
I take a long winded approach (to keep from becoming befuddled) :-) ..

memo1.setfocus;
memo1.selstart:= 0; // this 0 could/should be a var..you decide.
memo1.perform(EM_SCROLLCARET, 0,0);

Errol

Tom Kostiainen

unread,
Aug 1, 1998, 3:00:00 AM8/1/98
to
I asked the same question,
setting the cursor pos to 1 or 0 could work, haven't tested it yet...

David S

unread,
Aug 2, 1998, 3:00:00 AM8/2/98
to
TMemo doesn't have a cursor position. I solve this problem by selecting the
first (or any character depending on what you want visible) character in
Lines.

Memo.Lines.SelStart:=0; {first character could be any}
Memo.Lines.SelLength:=1; {move display cursor to this position}

David S

Tom Kostiainen wrote in message <35C36518...@sci.fi>...

0 new messages