Autor Beitrag
csigg
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 706

WIn XP, Win NT, Win2000, Suse8.0
Delphi 5, Delphi 6
BeitragVerfasst: Di 12.07.05 15:09 
kann ich ein StringGrid auf einmal leeren, ohne dass ich mit
StringGrid1.Rows[i].clear;jede zeile durchlaufe??
Also etwas in der Richtung (gibts ja leider nicht).
ausblenden Delphi-Quelltext
1:
StringGrid.clear;					
Luckie
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Di 12.07.05 15:18 
Was ist daran so schlimm? Und wenn es dich stört, schreib dir doch schnell selber die Prozedur:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
procedure ClearStringGrid(StringGrid: TStringGrid);
var
  i: Integer;
begin
  for i := 0 to StringGrid.RowCount - 1 do
    StringGrid.Row[i].Clear;
end;
csigg Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 706

WIn XP, Win NT, Win2000, Suse8.0
Delphi 5, Delphi 6
BeitragVerfasst: Di 12.07.05 15:25 
so hab ich das bis jetzt auch gemacht, aber könnte ja sein dass es da was einfacheres gibt.
Alpha_Wolf
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 297

Ubuntu, Win XP, Win Vista
C#, Delphi 6 Prof, Delphi 2007 Prof, Java
BeitragVerfasst: Di 12.07.05 15:31 
Machs lieber so wie cssig sagt..

oder die eher etwas bescheidene Art...

ausblenden Delphi-Quelltext
1:
StringGrid1.RowCount := 0;					


Edit:

äähm ja so wie luckie.. ich sollte mal wieder schlafen... ;)


Zuletzt bearbeitet von Alpha_Wolf am Di 12.07.05 15:34, insgesamt 1-mal bearbeitet
csigg Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 706

WIn XP, Win NT, Win2000, Suse8.0
Delphi 5, Delphi 6
BeitragVerfasst: Di 12.07.05 15:32 
So wie Luckie sagt, hast wohl gemeint *g*.

ja ok werd es dann wieder so machen.
JustusJonas
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 222



BeitragVerfasst: Do 17.11.05 13:55 
user profile iconLuckie hat folgendes geschrieben:
Was ist daran so schlimm? Und wenn es dich stört, schreib dir doch schnell selber die Prozedur:

procedure ClearStringGrid(StringGrid: TStringGrid);
var
i: Integer;
begin
for i := 0 to StringGrid.RowCount - 1 do
StringGrid.Rows[i].Clear;
end;


Da hat sich ein kleiner, aber feiner Fehler eingeschlichen.
Habs mal markiert, was in der Funktion imho geändert werden muss.

Greetz
Luckie
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Do 17.11.05 14:16 
Hab's nur mal eben so hier in den Editor gehackt und habe einen kleine Copy and Waste Schutz eingebaut. ;)