Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

RichEdit scrolling problem

Status
Not open for further replies.

cpfc

Programmer
Aug 4, 2003
23
GB
Hi...
When you scroll down to the very bottom of a rich edit control, then keep pressing the small down arrow on the scroll bar, it keeps scrolling until the bottom line of text is at the top of control... I managed to stop this problem...

However...
When resizing the rich edit control, the bottom line of text moves upwards...
How can I always keep the bottom line of text at the bottom of the control when the scroll bar is set to the very bottom?

Hope that makes sence and thanks in advance...
 
Did you try setting the scroll postion? Did that not work?

-pete
 
Yeah I've tried that, no luck...
 
Sure...
mesbox is a pointer to CRichEditCtrl...

mesbox->SetScrollPos(SB_VERT,mesbox->GetScrollLimit(SB_VERT));

That code sets the scrollbar to the bottom, however does not effect the text scrolling position in anyway, not even when I set the scroll bar to the very top...
 
Sure that just sets the scroll bar window postion. You want to actually scroll the window position so you need to use CWnd::ScrollWindow() or CWnd::ScrollWindowEx()

-pete
 
I tried the following:
mesbox->MoveWindow(0,0,rect.right-130,rect.bottom-25);
mesbox->ScrollWindow(0,-mesbox->GetScrollLimit(SB_VERT));
mesbox->Invalidate();

After resizing the window, I attempted to scroll the text to the very top, but this code never effected the text scrolling position at all...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top