胡 胡鸣 Unregistered / Unconfirmed GUEST, unregistred user! 2010-04-21 #1 在ListView中设定CheckBox为Tuue,当CheckBox选定时该行并未被选取,请问如何实现选定状态CheckBox下选定该行,当取消CheckBox选定时也同时取消该行的选择?
孟 孟不获 Unregistered / Unconfirmed GUEST, unregistred user! 2010-04-21 #2 procedure TForm25.lv1ItemChecked(Sender: TObject; Item: TListItem);begin item.Selected := Item.Checked;end;
procedure TForm25.lv1ItemChecked(Sender: TObject; Item: TListItem);begin item.Selected := Item.Checked;end;
H herui Unregistered / Unconfirmed GUEST, unregistred user! 2010-04-21 #3 procedure TForm1.ListView1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);var listitem:TListitem;begin listitem:=listview1.GetItemAt(x,y); if listitem.Checked then listitem.Selected:=true else listitem.Selected:=False;end;
procedure TForm1.ListView1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);var listitem:TListitem;begin listitem:=listview1.GetItemAt(x,y); if listitem.Checked then listitem.Selected:=true else listitem.Selected:=False;end;