读书人

listBox控件的有关问题

发布时间: 2012-01-15 22:57:49 作者: rapoo

listBox控件的问题
我用listbox::InsertString(int nIndex,CString str);
可是发现当listbox里出现足够多的项时,就会有滚动条,但是那个滚动条不会自动的网下滚的,怎么才能让他们往下滚呢?

[解决办法]
// Pointer to the list view control.
CListCtrl* pmyListCtrl;

// Ensure that the last item is visible.
int nCount = pmyListCtrl->GetItemCount();
if (nCount > 0)
pmyListCtrl->EnsureVisible(nCount1, FALSE);

[解决办法]
选中最后一项就向下滚了么
[解决办法]
m_cmdresultctrl.LineScroll(m_cmdresultctrl.GetLineCount()-10);
m_cmdresultctrl.PostMessage(WM_VSCROLL, SB_BOTTOM,0);//通知滚动
我前几天也遇到这样的问题
现在解决了
你加上面的代码就可以了
[解决办法]
这两个控件差不多的。
[解决办法]
楼上说的有道理

读书人网 >VC/MFC

热点推荐