1)垂直滚动到底端
POINT pt;
//取得滚动范围
GetDlgItem(IDC_EDIT1)->GetScrollRange(SB_VERT, (LPINT)&pt.x, (LPINT)&pt.y);
pt.x = 0;
GetDlgItem(IDC_EDIT1)->SendMessage(EM_LINESCROLL ,pt.x, pt.y);
2)同上
POINT pt;
RECT rect;
//取得编辑框的位置
GetDlgItem(IDC_EDIT1)->GetWindowRect(&rect);
pt.y = rect.bottom;
GetDlgItem(IDC_EDIT1)->SendMessage(EM_LINESCROLL , pt.x, pt.y);
3)同上
POINT pt;
//取得滚动范围
GetDlgItem(IDC_EDIT1)->GetScrollRange(SB_VERT, (LPINT)&pt.x,(LPINT)&pt.y);
pt.x = 0;
GetDlgItem(IDC_EDIT1)->SendMessage(EM_LINESCROLL , pt.x, pt.y);
3)同上
//第一个参数表示列值,第二个参数表示行值(EM_GETLINECOUNT表示编辑框的行数)
GetDlgItem(IDC_EDIT1)->SendMessage(EM_LINESCROLL , 0, EM_GETLINECOUNT);
4)滚动一行
GetDlgItem(IDC_EDIT1)->SendMessage(WM_VSCROLL, SB_LINEDOWN, 0);
4)滚动一行或一页
GetDlgItem(IDC_EDIT1)->SendMessage(EM_SCROLL, SB_LINEDOWN, 0);
GetDlgItem(IDC_EDIT1)->SendMessage(EM_SCROLL, SB_PAGEDOWN, 0);
http://bbs.csdn.net/topics/70418011
自动垂直滚动到底端的简便方法:
使用下面语句实现自动滚动:
m_gra_edit_conRecdata.LineScroll(m_gra_edit_conRecdata.GetLineCount());
其中m_gra_edit_conRecdata为编辑框关联的control型变量