GET ... MEMO How to display last line?

Post Reply
hua
Posts: 1075
Joined: Fri Oct 28, 2005 2:27 am
Has thanked: 1 time
Been thanked: 1 time

GET ... MEMO How to display last line?

Post 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
FWH 11.08/FWH 19.12
BCC5.82/BCC7.3
xHarbour/Harbour
User avatar
Antonio Linares
Site Admin
Posts: 42520
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 31 times
Been thanked: 75 times
Contact:

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

Post 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 ) )
regards, saludos

Antonio Linares
www.fivetechsoft.com
hua
Posts: 1075
Joined: Fri Oct 28, 2005 2:27 am
Has thanked: 1 time
Been thanked: 1 time

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

Post by hua »

Thanks for the prompt reply Antonio.
No luck yet so far
FWH 11.08/FWH 19.12
BCC5.82/BCC7.3
xHarbour/Harbour
User avatar
Enrico Maria Giordano
Posts: 8753
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Has thanked: 1 time
Been thanked: 4 times
Contact:

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

Post 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
hua
Posts: 1075
Joined: Fri Oct 28, 2005 2:27 am
Has thanked: 1 time
Been thanked: 1 time

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

Post by hua »

Enrico,
That works! Thanks a lot!
FWH 11.08/FWH 19.12
BCC5.82/BCC7.3
xHarbour/Harbour
Post Reply