Board index » cppbuilder » TMemo, scroll to specified line number

TMemo, scroll to specified line number


2004-12-12 09:57:01 PM
cppbuilder12
I know how to scroll to the first line or the last line in a memo but how do
I scroll to say line 25 in a TMemo?
/Jonas
 
 

Re:TMemo, scroll to specified line number

Ok maybe I should have tried google before posting, I found some help and
ended up with this (if anyone else has the same problem)
void TF_Memo::scroll_to_linenumber(const int nr)
{
if( nr < 0 || nr>Memo->Lines->Count)
return;
Memo->Perform(EM_LINESCROLL, 0, nr);
Memo->SelStart = Memo->Perform(EM_LINEINDEX, nr, 0);
Memo->SelLength = 0;
Memo->SetFocus();
}
"Jonas Andersson" < XXXX@XXXXX.COM >skrev i meddelandet
Quote
I know how to scroll to the first line or the last line in a memo but how
do
I scroll to say line 25 in a TMemo?

/Jonas