Scrolling CEdit
-
hi everyone, I want my CEdit to scroll to the bottom after a call to SetWindowText. The following code updates the scroll bar, so it looks like it's at the bottom, but the edit actually remains unscrolled: int max = m_edit.GetScrollLimit(SB_VERT); m_edit.SetScrollPos(SB_VERT, max, TRUE); I had the same results with GetScrollRange. What is the right way to scroll the edit? thanks, Jake ***** Jake Palmer www.duke.edu/~jp6
-
hi everyone, I want my CEdit to scroll to the bottom after a call to SetWindowText. The following code updates the scroll bar, so it looks like it's at the bottom, but the edit actually remains unscrolled: int max = m_edit.GetScrollLimit(SB_VERT); m_edit.SetScrollPos(SB_VERT, max, TRUE); I had the same results with GetScrollRange. What is the right way to scroll the edit? thanks, Jake ***** Jake Palmer www.duke.edu/~jp6
Hi, I used this function in a CEdit-derived class:
void CChatEdit::AddString(LPCTSTR str)
{
CString tmp;
GetWindowText(tmp);if (!tmp.IsEmpty()) tmp += "\\r\\n"; tmp += str; SetWindowText(tmp); LineScroll(GetLineCount());
}
To add a line of text and scroll to the bottom. I hope it works for you too :) (you never know) Paolo ------ "airplane is cool, but space shuttle is even better" (J. Kaczorowski)