listbox control控件,m_list_info.AddString(strMsg);多行当中怎么才能添加到第一行?

asasj57 2010-12-25 06:49:11
listbox control控件,m_list_info.AddString(strMsg);这样写的话会添加到尾部也就是最下面,但是我想添加到最上面第一行的话,应该用什么函数才行呢?
...全文
160 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
vidy.tu 2010-12-25
  • 打赏
  • 举报
回复
应该有InsertString吧,如果没有的话,那就想点别的办法,可以先把放进去的全取出来存着,放完新加的再放进去……不过这样不多见哈。
疯狂石头_ 2010-12-25
  • 打赏
  • 举报
回复
CListBox::InsertString
int InsertString( int nIndex, LPCTSTR lpszItem );

Return Value

The zero-based index of the position at which the string was inserted. The return value is LB_ERR if an error occurs; the return value is LB_ERRSPACE if insufficient space is available to store the new string.

asasj57 2010-12-25
  • 打赏
  • 举报
回复
我刚试过了,没有InsterString这个属性啊我用的是VC2008
在次说明,我用的是listbox control控件,而不是List Control这个控件
mayudong1 2010-12-25
  • 打赏
  • 举报
回复
InsterString可以指定添加到第几行

15,979

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 界面
社区管理员
  • 界面
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧