From: Syj on
I have a CEdit control witha a vertical scroll bar in my dialog.
The text in the CEditView gets updated periodically. The problem is
when the user is reading the edit box at a particaular scroll position,
and an update occurs, scroll position goes to the bottom where it got
updated. This is because I set the cursor and update it (using setsel).


What I need to do is not disrupt what the user is reading.
I've tried SetScrollPos(). it just seems set the position of the scroll
bar without affecting the text view.

Any suggestions? TIA

From: AliR on
Would this work for you?

int LineNum = m_Edit.GetFirstVisibleLine();
.....Set the new text
m_Edit.LineScroll(LineNum);

AliR.

"Syj" <npeasy(a)hotmail.com> wrote in message
news:1109183240.639099.313350(a)f14g2000cwb.googlegroups.com...
> I have a CEdit control witha a vertical scroll bar in my dialog.
> The text in the CEditView gets updated periodically. The problem is
> when the user is reading the edit box at a particaular scroll position,
> and an update occurs, scroll position goes to the bottom where it got
> updated. This is because I set the cursor and update it (using setsel).
>
>
> What I need to do is not disrupt what the user is reading.
> I've tried SetScrollPos(). it just seems set the position of the scroll
> bar without affecting the text view.
>
> Any suggestions? TIA
>


From: Joseph M. Newcomer on
It sounds like you are using the edit control as some sort of output logging control. I
learned years ago that this is a fundamentally losing idea. The reason is that trying to
manage the scroll position is a complete and utter nightmare.

If all you want to do is list output lines, and don't need to select pieces of lines, a
listbox works a whole lot better; see my Logging Listbox Control on my MVP Tips site. In
particular, it is designed to not disrupt what the user is looking at, but if at the end,
it will scroll. You could use that part of it without the rest of my control.
joe

On 23 Feb 2005 10:27:20 -0800, "Syj" <npeasy(a)hotmail.com> wrote:

>I have a CEdit control witha a vertical scroll bar in my dialog.
>The text in the CEditView gets updated periodically. The problem is
>when the user is reading the edit box at a particaular scroll position,
>and an update occurs, scroll position goes to the bottom where it got
>updated. This is because I set the cursor and update it (using setsel).
>
>
>What I need to do is not disrupt what the user is reading.
>I've tried SetScrollPos(). it just seems set the position of the scroll
>bar without affecting the text view.
>
>Any suggestions? TIA

Joseph M. Newcomer [MVP]
email: newcomer(a)flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm