问个vc的小问题。

来源:百度知道 编辑:UC知道 时间:2024/05/24 12:36:31
请问vc 6.0中的 list控件, 我想用这个空间聊天室,怎么让他自动滚屏呢?谢谢了

你的自动滚屏是什么意思?是总是显示最下面的一条信息吗?如果是的话,你可以这样去实现:
CListBox m_List;
int InsertString (int nIndex, LPCTSTR lpszItem)
int SetTopIndex (int nIndex)

例如:
CListBox m_List;
int iCount;
int iLast;
CString str;

for(int j=0; j<100; j++)
{
iCount = m_List.GetCount();
str.Format("%d", iCount);
iLast = m_List.InsertString(iCount, (LPCTSTR)str);
m_List.SetTopIndex(iLast);
Sleep(10);
}