【VS开发】CListBox智能滚动设置

添加数据以后,再在下面加句,
int nCount = m_myListBox.GetCount();
if (nCount > 0)
m_myListBox.SetCurSel(nCount - 1);


其实是在output页卡中实现自动滚动显示最新添加的info,因为

    COutputList m_wndOutputInfo;

    m_wndOutput.m_wndOutputInfo.AddString(str);//输出信息
    int nCount = m_wndOutput.m_wndOutputInfo.GetCount();
    if(nCount>0)
        m_wndOutput.m_wndOutputInfo.SetCurSel(nCount - 1);
    str.Empty();

2016-5-4
张朋艺 pyzhangbit2010@126.com

原文地址:https://www.cnblogs.com/huty/p/8518671.html