(1)建一个对话框工程;
(2)在对话框中添加ListBox控件;
(3)给添加的ListBox控件右键添加控制变量,m_ListBox;
(4) 利用CListBox::SetCaretIndex实现图标滚动条跟随文本行的增加而移动;
例如:m_ListBox.SetCaretIndex(m_ListBox.InsertString(m_ListBox.GetListBoxInfo(), str),0);
以上这句话的意思是:往m_ListBox.GetListBoxInfo()行添加str字符串,m_ListBox.SetCaretIndex()实现图标滚动条随文本行的增加而移动;