Page 1 of 1

GET ... MEMO How to display last line?

Posted: Wed Sep 28, 2022 8:43 am
by hua
Hi,
How to programmatically go to the last line of a TMultiGet control (GET...MEMO) ?
With the keyboard I had to click on the control to give it focus then press Ctrl+End

TIA

Re: GET ... MEMO How to display last line?

Posted: Wed Sep 28, 2022 8:51 am
by Antonio Linares
Dear Hua,

Using VB they solve it this way:
Text1.SelStart = len(Text1.Text)

Have you tried oMultiGet:GoBottom() ?

Also you could try oMultiGet:SetPos( Len( oMultiGet:cText ), Len( oMultiGet:cText ) )

Re: GET ... MEMO How to display last line?

Posted: Wed Sep 28, 2022 10:07 am
by hua
Thanks for the prompt reply Antonio.
No luck yet so far

Re: GET ... MEMO How to display last line?

Posted: Wed Sep 28, 2022 10:23 am
by Enrico Maria Giordano
I'm using this modified method (you can change it to a function):

Code: Select all | Expand

METHOD GoBottom() CLASS TMultiGet

    LOCAL nPos := LEN( ::VarGet() ) + 1

    ::SendMsg( EM_SETSEL, nPos, nPos )

    ::SendMsg( EM_LINESCROLL, 0, ::SendMsg( EM_GETLINECOUNT ) )

    RETURN NIL

Re: GET ... MEMO How to display last line?

Posted: Thu Sep 29, 2022 1:19 am
by hua
Enrico,
That works! Thanks a lot!