Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Edit window problem.

Hi All
How can I stop the text I send to my edit window from scrolling off the bottom of the window? I wish to keep the last appended text added to the window in view and have the previous text scroll up out of sight. eg. the window adds text at the top, then adds text to the next line below etc until it reaches the bottom of the window. Then all new text is still appended but kept in view, the old text will scroll up. Or something similar will do.

I use C calling WIN32 API.: CreateWindow () to create the edit box.
I set the text using: SetDlgItemText()

Cheers
kev

Comments

  • tom_swtom_sw Posts: 828Member
    : Hi All
    : How can I stop the text I send to my edit window from scrolling off the bottom of the window? I wish to keep the last appended text added to the window in view and have the previous text scroll up out of sight. eg. the window adds text at the top, then adds text to the next line below etc until it reaches the bottom of the window. Then all new text is still appended but kept in view, the old text will scroll up. Or something similar will do.
    :
    : I use C calling WIN32 API.: CreateWindow () to create the edit box.
    : I set the text using: SetDlgItemText()
    :
    : Cheers
    : kev
    :
    One technique is to use a ListBox control. When you add data, you simply append a new string to the ListBox and then adjust the view to have the latest line visible. I do this with MFC, so the CListBox functions are AddString and SetTopIndex. I am not sure what the API calls would be.
  • AsmGuru62AsmGuru62 Posts: 6,519Member
    : : Hi All
    : : How can I stop the text I send to my edit window from scrolling off the bottom of the window? I wish to keep the last appended text added to the window in view and have the previous text scroll up out of sight. eg. the window adds text at the top, then adds text to the next line below etc until it reaches the bottom of the window. Then all new text is still appended but kept in view, the old text will scroll up. Or something similar will do.
    : :
    : : I use C calling WIN32 API.: CreateWindow () to create the edit box.
    : : I set the text using: SetDlgItemText()
    : :
    : : Cheers
    : : kev
    : :
    : One technique is to use a ListBox control. When you add data, you simply append a new string to the ListBox and then adjust the view to have the latest line visible. I do this with MFC, so the CListBox functions are AddString and SetTopIndex. I am not sure what the API calls would be.
    :
    [blue]Use multi-line edit control with ES_WANTRETURN style. To add a line of text to such control use the EM_REPLACESEL message. The line you send to control have to end with "
    " pair of symbols.
    [/blue]
  • kevanwoodcockkevanwoodcock Posts: 172Member
    : : : Hi All
    : : : How can I stop the text I send to my edit window from scrolling off the bottom of the window? I wish to keep the last appended text added to the window in view and have the previous text scroll up out of sight. eg. the window adds text at the top, then adds text to the next line below etc until it reaches the bottom of the window. Then all new text is still appended but kept in view, the old text will scroll up. Or something similar will do.
    : : :
    : : : I use C calling WIN32 API.: CreateWindow () to create the edit box.
    : : : I set the text using: SetDlgItemText()
    : : :
    : : : Cheers
    : : : kev
    : : :
    : : One technique is to use a ListBox control. When you add data, you simply append a new string to the ListBox and then adjust the view to have the latest line visible. I do this with MFC, so the CListBox functions are AddString and SetTopIndex. I am not sure what the API calls would be.
    : :
    : [blue]Use multi-line edit control with ES_WANTRETURN style. To add a line of text to such control use the EM_REPLACESEL message. The line you send to control have to end with "
    " pair of symbols.
    : [/blue]
    :

    Thanks everybody.
    After reading your replys i found this.

    SendMessage( Handle_DialogBx_PIS_Interpretor, EM_LINESCROLL, 10, 10 );


    first i use SetDlgItemText() and then the above sendmessage. It does not work. I was hoping it would scroll the edit window down 10 lines.
    Do i need to do something in the proc loop to handle the message "EM_LINESCROLL"? or am i going off in the wrong direction. ?
    I have added "ES_WANTRETURN" tothe edit window and made it MultiLine.

    kev

Sign In or Register to comment.