Windows programming

Moderators: None (Apply to moderate this forum)
Number of threads: 3670
Number of posts: 9122

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Edit window problem. Posted by kevanwoodcock on 14 Dec 2005 at 10:16 AM
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

Report
Re: Edit window problem. Posted by tom_sw on 14 Dec 2005 at 12:43 PM
: 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.
Report
Re: Edit window problem. Posted by AsmGuru62 on 14 Dec 2005 at 11:49 PM
: : 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.
:
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 "\r\n" pair of symbols.

Report
Re: Edit window problem. Posted by kevanwoodcock on 15 Dec 2005 at 11:15 AM
: : : 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.
: :
: 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 "\r\n" pair of symbols.
:

:

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




 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.