Einzelnen Beitrag anzeigen

aaron

Registriert seit: 18. Feb 2003
202 Beiträge
 
Delphi 2007 Professional
 
#17

Re: Ausgewählte Zeilen e. Stringgrid's i.e. anderes Stringg

  Alt 24. Mär 2008, 13:24
So komme ich nun auch ans Ziel, obwohl ich ja gerne gewußt hätte was ich falsch mache:
Delphi-Quellcode:
procedure TForm1.Button1Click(Sender: TObject);
var
  i: Integer;
  state: boolean;
begin
  Listbox1.Items.Clear;

  for i := 1 to StringGrid1.RowCount - 1 do
  begin
    if stringgrid1.GetCheckBoxState(0,i,state) then
    begin
      if state then
      begin
        StringGrid1.SetCheckBoxState(0,i,false);
        ListBox1.Items.Add(Stringgrid1.Cells[1,i]+';'+Stringgrid1.Cells[2,i]);
        ListBox1.Items.SaveToFile(extractfilepath(application.exename)+'data\tmp.txt');
        end;
    end;
  end;
  if listbox1.Items.Count = 0 then
    ShowMessage('No items selected');
   StringGrid1.Invalidate;

  StringGrid2.Clear;
  Form1.StringGrid2.Delimiter := ';';
  StringGrid2.loadfromCSV(extractfilepath(application.exename)+'data\tmp.txt');
end;
Freundliche Grüße
Aaron
  Mit Zitat antworten Zitat