TListView.FindCaption(0, 'YourCaption', True, True, True);

解决方案 »

  1.   

    返回的是TListItem,如果没有找到~~则返回Nil~~
      

  2.   

    如果返回的士TListItem,比如我的ListView有2个SUBITEM,我想得到这个ListView的Caption,和2个SubItem,该怎么作? 同时FindCaption的3个Boolean属性表示什么?
      

  3.   

    得到了这个Items,不就可以得到Items的SubItem了吗?
    TListItem.SubItems[0]
    TListItem.SubItems[1]
    帮助里面,不是对这三个参数又说明吗?(不要跟我说,你英语不好,读不懂)
    Call FindCaption to search for a list view item labeled by the string specified as the Value parameter. If the Inclusive parameter is True, the list item specified by StartIndex is the first item checked. Otherwise, the search starts on the next item. If the Wrap parameter is True, the search continues at the top of the list if a match has not been found before reaching the bottom. FindCaption returns the first item with the Caption property equal to Value. If the Partial parameter is True, a Caption matches if it starts with the substring Value. If Partial is False, the Caption must match Value exactly. If no item is found, FindCaption returns nil.
      

  4.   

    chechy(chechy) 
      你的耐心真好~我就是懒~~呵呵~
      

  5.   

    To  chechy(chechy) 回复于2001-9-2 21:27:13谢谢了,我刚才是用Items 试了,因为返回是nil,而我又没对Items进行判断,所以我
    取Items.Caption 老是报错。分数奉上了,谢谢。同时你如果可以的话,是否可以留下你
    的联系办法,彼此交流一下DELPHI的经验。谢谢!!!