Solved

Scrolling a CLX TMemo

Posted on 2002-04-12
1
278 Views
Last Modified: 2010-04-04
I need to scroll a TMemo to the current caret position.  I know how to do this in Windows but how would I do it in Kylix?

Windows code:
SendMessage(LogMemo.Handle, EM_SCROLLCARET, 0, 0);

0
Comment
Question by:abarilla
1 Comment
 

Accepted Solution

by:
ms99 earned 50 total points
ID: 6956473
Hi, abarilla:

In Kylix (and also Delphi6 using clx) TMemo has a new property: CaretPos.

In order to move the caret you set this property:

var
  c:tcaretPos;

c.line := 1;  
c.col := 1;
memo1.caretPos := c;

c.line := memo1.lines.count-1;  
c.col := 1;
memo1.caretPos := c;

When you set memo1.caretPos, the control automatically scrolls to make the caret visible.

I think:
 
c := memo1.caretPos;
memo1.caretPos := c;

will scroll memo1 to make the caret visible.

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now