我在使用TListView控件时Multiselect=true;HideSelection=false;style=report,请问我不连续的选择多行时,怎样将这些被选中行(Item)的Caption读出来???

解决方案 »

  1.   

    用循环测试每一项是否被选中
    然后用IF 判断再将选中的项 的CAPTION值取出来
      

  2.   

    在ONITEMSELECT的过程中有一个参数就是你要的CAPTION的下标。
      

  3.   

    procedure TForm1.Button2Click(Sender: TObject);
    var
      i:integer;
    begin
      with Listview1 do
        if SelCount>=1 then
        begin
          for i:=ItemIndex to Items.Count-1 do
            if items[i].Selected then
              memo1.Lines.Add(items[i].Caption);
        end;
    end;
      

  4.   

    只是广告
    请大家支持下。。谢谢!
    http://community.csdn.net/Expert/topic/3632/3632147.xml?temp=.2835962
    http://community.csdn.net/Expert/topic/3607/3607671.xml?temp=.128689