Einzelnen Beitrag anzeigen

aaron

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

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

  Alt 24. Mär 2008, 13:15
Das mit der Listbox klappt:
Delphi-Quellcode:
procedure TForm1.Button2Click(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]);
        end;
    end;
  end;
  if listbox1.Items.Count = 0 then
    ShowMessage('No items selected');
  StringGrid1.Invalidate;
end;
  Mit Zitat antworten Zitat