delphi的ListView控件怎么判断当勾选checkbox时,选的是第几行

delphi的ListView控件如何判断当勾选checkbox时,选的是第几行?
delphi的ListView控件如何判断当勾选checkbox时,选的是第几行?
viewstyle:=vsList;

我是想在ListView 的OnClick事件中判断,当点击某行前面的checkbox时,知道对应的是第几行?

看网上的资料,是用: ListView1.Selected.Index。这样在选中某行(非勾选checkbox)的时候返回值是对的,但是选中checkbox时的返回值是不对的。


请问,如何达到如题的目的?
谢谢。。。

------解决方案--------------------
Delphi(Pascal) code
procedure TForm1.lv1MouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
var
  item: TListItem;
begin
  item := lv1.GetItemAt(X, Y);
  if item <> nil then
  begin
     ShowMessage(item.Caption);
  end;
end;

------解决方案--------------------
[code=Delphi(Pascal)][/code]unit Unit3;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ComCtrls;

type
TForm3 = class(TForm)
ListView1: TListView;
Button1: TButton;
procedure ListView1Changing(Sender: TObject; Item: TListItem;
Change: TItemChange; var AllowChange: Boolean);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form3: TForm3;

implementation

{$R *.dfm}

procedure TForm3.ListView1Changing(Sender: TObject; Item: TListItem;
Change: TItemChange; var AllowChange: Boolean);
begin
ShowMessage(IntToStr(Item.Index));
end;

end.