TodWulff
Joined: 29 Dec 2007 Posts: 99
|
Posted: Thu Apr 17, 2008 3:50 am Post subject: Multi-Line Edit Control Prevent Scrolling on update |
|
|
Hey folks.
Is there a way to prevent a multi-line edit control from scrolling when text is added to it?
If I do a SEND to the control, the control sets the cursor to the bottom of the edit box, just as if the user was typing therein (duh), but if I do a CONTROLSETTEXT, then it resets the control and places the cursor at the top of the control's contents.
My goal is this: I have a multiline edit control which is the console for a serial based device. It is all working as desired, except for this one feature of the console...
I'd like the edit control to auto-scroll if the scroll bar is at the bottom, when new lines of text are received, but I'd like to freeze the text displayed, if the user scrolls up to a specific portion of the previously received text - i.e. the scroll bar is anywhere but at the bottom of the control. Newly received characters should append to the trailing end of the control's text, but when in this non-auto-scrolling mode, the position of the displayed text doesn't change.
Does anyone have any code they can let me make use of, so that I don't have to reinvent the wheel here, or can offer up some suggested code, so that I could implement same?
Please review and advise. Thank you, in advance. Take care.
-t _________________ When replying, please feel free to address me as Tod or t. My AHK.net site... |
|