GET ... MEMO How to display last line?

GET ... MEMO How to display last line?

Postby hua » Wed Sep 28, 2022 8:43 am

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
hua
 
Posts: 1072
Joined: Fri Oct 28, 2005 2:27 am

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

Postby Antonio Linares » Wed Sep 28, 2022 8:51 am

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
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

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

Postby hua » Wed Sep 28, 2022 10:07 am

Thanks for the prompt reply Antonio.
No luck yet so far
FWH 11.08/FWH 19.12
BCC5.82/BCC7.3
xHarbour/Harbour
hua
 
Posts: 1072
Joined: Fri Oct 28, 2005 2:27 am

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

Postby Enrico Maria Giordano » Wed Sep 28, 2022 10:23 am

I'm using this modified method (you can change it to a function):

Code: Select all  Expand view
METHOD GoBottom() CLASS TMultiGet

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

    ::SendMsg( EM_SETSEL, nPos, nPos )

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

    RETURN NIL
User avatar
Enrico Maria Giordano
 
Posts: 8715
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

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

Postby hua » Thu Sep 29, 2022 1:19 am

Enrico,
That works! Thanks a lot!
FWH 11.08/FWH 19.12
BCC5.82/BCC7.3
xHarbour/Harbour
hua
 
Posts: 1072
Joined: Fri Oct 28, 2005 2:27 am


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 66 guests