Board index » delphi » How to make TMemo scroll to a specific line?

How to make TMemo scroll to a specific line?

I am trying to make my Memo scroll to a specific line.

I have tried SendMessage API call, but it only works with Page-Down or
Line-Down-very general scrolling.  

I have tried ScrolltoPos API call, it still is not working properly.
The 'thumb' of scrollbar moved, but the content of the memo didn't.
How come???

Any information will appreciated.

TIA

 

Re:How to make TMemo scroll to a specific line?


In article <31901e4c.1158...@dfw-ixnews1.ix.netcom.com>,
renew...@ix.netcom.com says...

Quote
>Any information will appreciated.

The only case in which I needed to make a Memo scroll was
when I highlighted a string which I searched for in the Memo's Text.
The Memo scrolled itself so that the string would be visible. If I
understand you right, you want to implement a kind of "Go to line"
function. If this is the case, let me know and I will send you some
code. What it does is to set the Memo's StartSel to the begining of
the desired line and then the SelLength to the length of the desired
line. Then all your line will be highlighted. If you set SelLength to 0
then the cursor will be placed at the very begining of the desired line.

Catalin

Other Threads