[EMAIL PROTECTED] wrote:
> Hopefully this will be a quick answer to a question that's been baffling 
> me for a while....
> 
> I'm writing output to a log file and using a standard TMemo component.
> In my main processing, I add lines to the Memo as normal 
> Memo1.Lines.Add('some text');
> I have approx. 100 lines in the Memo, and a vertical scrollbar, but when I 
> have finished adding lines to the Memo, I need to return to the 1st line 
> in the Memo rather than getting the User to scroll up to the beginning 
> themselves.
> I've looked at all the properties of TMemo, and can't find one to do this 
> - can anyone help?
> Ideally would like a Memo1.ReturnToTop property! 

Setting the SelStart property to 0 should do it.

However, I can't recall off the top of my head whether or not setting 
the SelStart property also scrolls the memo's display to keep the caret 
visible.

If not then setting SelStart to 0 and THEN sending the EM_SCROLLCARET 
message thusly:

   Memo1.Perform(EM_SCROLLCARET, 0, 0);

should definitely do it.

HTH

Stephen Posey
[EMAIL PROTECTED]
_______________________________________________
Delphi mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi

Reply via email to