uses commctrl;
const
gesperrt: set of 1..5 = [1, 4, 5];
procedure TForm1.FormCreate(Sender: TObject);
var
li: TListitem;
x: integer;
begin
Listview1.Readonly := false;
// ------- zum Testen -----------
if Listview1.columns.count = 0 then
Listview1.columns.add;
Listview1.Items.clear;
for x := 1 to 5 do begin
li := Listview1.items.add;
li.caption := 'Items ' + inttostr(x);
end;
// ------------------------------
end;
procedure TForm1.ListView1Editing(Sender: TObject; Item: TListItem;
var AllowEdit: Boolean);
begin
if (Item.Index + 1) in gesperrt then
sendmessage(Listview1.handle, LVM_EDITLABEL, -1, 0);
end;