var
i, j: integer;
begin
i := 0;
while (i < CheckListBox1.Items.Count-1) do
begin
if CheckListBox1.Checked[i] = true then
inc(i)
else
break;
end;
j := i;
while (j <= CheckListBox1.Items.Count-1) do
begin
if CheckListBox1.Checked[j] = true then
begin
CheckListBox1.Items.Exchange(j, i);
CheckListBox1.Checked[i] := true;
CheckListBox1.Checked[j] := false;
inc(i);
end;
inc(j);
end;
end;