//全选 Checked All
procedure TForm1.Button11Click(Sender: TObject);
var i :integer;
begin
for i := 0 to CheckListBox1.Items.Count - 1 do
begin
CheckListBox1.Checked[i] := True;//反选设置为False
end;
end;
//删除已勾选的中项目
procedure TForm1.Button5Click(Sender: TObject);
var i : integer;
begin
for i := CheckListBox1.Items.Count-1 downto 0 do //从后面往前面删
begin
if CheckListBox1.Checked[i] then
begin
CheckListBox1.Items.Delete(i);
end;
end;
end;
//清空项目
CheckListBox1.Items.Clear;
//将CheckListBox1的全部添加到CheckListBox2的Items中
procedure TForm1.Button1Click(Sender: TObject);
var
i:Integer;
begin
CheckListBox2.Items.Clear;
for i := CheckListBox1.Items.Count - 1 downto 0 do
begin
CheckListBox2.Items.Add(CheckListBox1.Items[i]);
end;
end;