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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Rich Edit Scrolling too much

Status
Not open for further replies.

MarkPQ

Programmer
Feb 21, 2002
7
AU
I'm having a problem with a rich edit control in my dialog app! I want to use the Rich Edit box to display messages on the status of serial communcations, basically as a debugging tool.

Anyway, I've made it 15 lines long and I want to have the newest line placed at the bottom and have the lines scroll up. I wrote the code to do this but for some reason after it has done one scroll, every subsequent scroll goes up by two lines!?

Here is my code:

UpdateCommStatus(CString Message)
{
UpdateData(TRUE);
m_CommStatus = m_CommStatus + Message + "\n";
UpdateData(FALSE);
if(m_CommStatusControl.GetLineCount() > 17)
m_CommStatusControl.LineScroll(1,0);
}

m_CommStatus is the CString value attached to the Richedit while m_CommStatusControl is the control variable. So in this case it would dispay the messages up to line 16, then scroll once on line 17 making it the very bottom, but all susequent scrolls will go twice making the list dissapear in about 8 more messages!?

Any help appreciated!
Thanks
-Mark
 
Solved the problem already,

It was autoscrolling at the same time (Hence 2 scrolls) so I just have to call the linescroll function when I get to the line where I want to begin scrolling!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top