为什么要把insertitem写在setitemtext之前才能正常的对listctrl进行数据插入,还有就是setitemtext的数据是存储在哪里的,insertitem通过iItem来调用么?谢谢大家了~

解决方案 »

  1.   

    当然要在setitemtext之前insertitem,否则Item都还没有,怎么设置该Item的文本呢?
    setitemtext数据存储在由CListCtrl对象维护的内存中。
      

  2.   

    1、先创建了才能更改
    2、存储在窗口关联数据中的,CListCtrl是对系统内建的窗口类List-View的封装,其实作为使用方我们也不用关心了。
      

  3.   

    谢谢,两位的回答,我还想问下,setitemtext有长度限制么?为什么我插入备注类型的一段文字不能显示呢?
      

  4.   

    If the structure receives item attributes, pszText is a pointer to a buffer that receives the item text. Note that although the list-view control allows any length string to be stored as item text, only the first 260 TCHARs are displayed.
      

  5.   

    谢谢,请问怎么给分呀?lvitem中的isubitem是设置什么的呢?