Solved

Scrolling a CLX TMemo

Posted on 2002-04-12
1
281 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

733 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