1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20:
| procedure TForm1.Button1Click(Sender: TObject); var Schleife : integer; Zeile : integer; begin Zeile := - 1; StringGrid1.Cells[0, 0] := 'Beschriftung'; StringGrid1.Cells[0, 1] := 'A'; StringGrid1.Cells[0, 2] := ' '; StringGrid1.Cells[0, 3] := 'C'; StringGrid1.Cells[0, 4] := 'D'; for Schleife := StringGrid1.RowCount - 1 downto 0 do if Trim(StringGrid1.Cells[0, Schleife]) = '' then Zeile := Schleife; if Zeile > - 1 then Label1.Caption := 'Zeile ' + IntToStr(Zeile) + ' (Null-basiert) ' + 'enthält die erste leere Zelle in der ersten Spalte.' else Label1.Caption := 'Keine leere Zelle gefunden.'; end; |