如题:
  具有添加后,不用手动拖动滚动条了。

解决方案 »

  1.   

    添加list item后,使用CListCtrl::Scroll(CSize);
    如果添加的list item 不在最后一行,需要使用CListCtrl::GetTopIndex()得到可见的第一个item index。根据新添加的list item的index,计算出需要滚动的距离。使用CListCtrl::Scroll(CSize); list item的高度可以使用BOOL GetItemRect(int nItem, LPRECT lpRect, UINT nCode/*=LVIR_BOUNDS*/) const;得到
      

  2.   

    pListCtrl->EnsureVisiable(pListCtrl->GetItemCount());
      

  3.   

    int nCount = m_LIST.GetItemCount();
    BOOL temp=m_LIST.EnsureVisible(nCount,TRUE);
    可是temp老是返回0,没有实现滚动,请问可能是什么原因造成的
      

  4.   

    tcbc2124() BOOL temp=m_LIST.EnsureVisible(nCount - 1,TRUE);减1试试