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
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