Announcement

Collapse
No announcement yet.

Need to show last line of edit box

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Francesco Danuso
    replied
    Mark,

    I have used this method (print, count number of lines, scoll)
    that seems to work:

    CONTROL SET TEXT hDLG, %ID, Text$
    CONTROL SEND hDLG, %ID,%EM_GETLINECOUNT,0,0 TO NumLines&
    CONTROL SEND hDLG, %ID,%EM_LINESCROLL,0,NumLines&

    Regards

    Francesco

    ------------------

    Leave a comment:


  • Borje Hagsten
    replied
    The following will show the last line two positions down in the
    editor. Change -2 to preferred position, or use window size/character
    height to calculate how many positions down you need it to be.

    Code:
      LOCAL selLine AS LONG, visLine AS LONG
     
      selLine = SendMessage( hEdit, %EM_GETLINECOUNT, 0, 0) -1    '<- current line count -1
      visLine = SendMessage(hEdit, %EM_GETFIRSTVISIBLELINE, 0, 0) '<- get top visible line
      selLine = selLine - visLine -2                              '<- pos 2 lines down
      SendMessage hEdit, %EM_LINESCROLL, 0, selLine               '<- scroll to line

    ------------------

    Leave a comment:


  • Gregery D Engle
    replied
    <deleted> didn't pay attention to original question.

    ------------------
    -Greg

    [This message has been edited by Gregery D Engle (edited December 18, 2000).]

    Leave a comment:


  • mark smit
    Guest started a topic Need to show last line of edit box

    Need to show last line of edit box

    Good Day!


    Does anybody know how to ALWAYS show the last line of an edit box? I have tried sending EM_LINESCROLL message but it doesn't always work?

    ------------------
    Cheers
Working...
X