OnMouseDown中procedure TForm1.ListView1MouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
var
    ln: TListItem;
begin
    Ln:=ListView1.GetItemAt(x,y);
    if (ln<>nil) and ln.checked then
    Showmessage(ln.Caption)
end;

解决方案 »

  1.   

    procedure TForm1.ListView1MouseDown(Sender: TObject; Button: TMouseButton;
      Shift: TShiftState; X, Y: Integer);
    var
        ln: TListItem;
    begin
        Ln:=ListView1.GetItemAt(x,y);
        if (ln<>nil) and ln.checked then
        Showmessage(ln.SubItems[n])
    end;
      

  2.   

    不知道你是不是这个意思,我没判断checkbox,我只判断的是否被选中;var I : integer;
    begin
      for I:=0 to ListView1.Items.Count - 1 do begin
        if ListView1.Items[i].Selected then //选中
          showmessage(ListView1.Items[i].SubItems.Strings[2])
          //这一记录的某个字段的值;
      end
    end;
      

  3.   

    to netlib:
       你的方法我试过了,第一次点击combox时(true)可以显示caption,但再次点击时(false),就出错
      

  4.   

    那里来的combox,不明白,
    我刚测试了,没有问题,你一定是其它地方的问题了。
      

  5.   

    那里来的combox,不明白,
    我刚测试了,没有问题,你一定是其它地方的问题了。
      

  6.   

    哦,我写错了,就是一条记录前的checkbox,反复的点击它,就会出问题
      

  7.   

    ok,问题解决了,原来是我在mouseup里也写了代码,所以导致出错,谢谢各位,铁别是netlib