versuche über einen Button ein String aus einer CheckListBox in ein StringGrid zu kopieren.
Soweit geht auch alles, es wird aber immer alles in die erste Zeile im StringGrid kopiert.
Was ist hier falsch?
Code: Alles auswählen
procedure TForm1.BitBtn18Click(Sender: TObject);
var
i : integer;
s : string;
begin
CheckListBox1.Visible:= False;
for i := 0 to CheckListBox1.Items.Count - 1 do
if (CheckListBox1.Checked[i]) and (BitBtn8.Enabled = False) then begin
s := s + CheckListBox1.Items[i] + #13#10;
StringGrid1.Cells [3, StringGrid1.FixedRows] := (s);
end;
CheckListBox1.Clear;
CheckListBox1.Enabled:= True;
BitBtn8.Enabled:= True;
end;