Autor Beitrag
rob87
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 461

Win Me, Win XP Home, Win XP Prof
Delphi 2007 Enterprise
BeitragVerfasst: Do 31.01.08 07:49 
Hallo,

ich möchte beim BtnClose, also beim Schließen eines Formulares das StringGrid möglichst einfach komplett leeren. Weiß da jemand was?

Oder muss ich des mit der Schleife machen, wo ich einfach überall den Wert '' reinfüll?
rob87 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 461

Win Me, Win XP Home, Win XP Prof
Delphi 2007 Enterprise
BeitragVerfasst: Do 31.01.08 07:56 
Hat sich erledigt. Habs einfach mit ner Schleife gemacht:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
procedure TfrmVerbrAnz.BtnEndeClick(Sender: TObject);
var
  i,x : Integer;
begin
  x := 1;
  for i := 1 to SG1.RowCount do
    begin
      SG1.Cells[0,x] := '';
      SG1.Cells[1,x] := '';
      SG1.Cells[2,x] := '';
      SG1.Cells[3,x] := '';
      SG1.Cells[4,x] := '';
      SG1.Cells[5,x] := '';
      x := x+1;
    end;

  close;
end;
hazard999
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 162

Win XP SP2
VS 2010 Ultimate, CC.Net, Unity, Pex, Moles, DevExpress eXpress App
BeitragVerfasst: Do 31.01.08 08:00 
URGH! BUG!


ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
var iIdx, jIdx : integer;
begin
   for iIdx := SG1.FixedRows to SG1.RowCount - 1 do
      for jIdx := SG1.FixedCols to SG1.ColCount - 1 do
         SG1.Cells[jIdx,iIdx] := '';
end;


das wäre besser...

r u

René

_________________
MOV EAX, Result;MOV BYTE PTR [EAX], $B9;MOV ECX, M.Data;MOV DWORD PTR [EAX+$1], ECX;MOV BYTE PTR [EAX+$5], $5A;MOV BYTE PTR [EAX+$6], $51;MOV BYTE PTR [EAX+$7], $52;MOV BYTE PTR [EAX+$8], $B9;MOV ECX, M.Code;MOV DWORD PTR [EAX+$9], ECX
alzaimar
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2889
Erhaltene Danke: 13

W2000, XP
D6E, BDS2006A, DevExpress
BeitragVerfasst: Do 31.01.08 08:03 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
var iIdx : integer;
begin
   for iIdx := SG1.FixedRows to SG1.RowCount - 1 do
      SG1.Rows[iIdx].Clear;
end;

_________________
Na denn, dann. Bis dann, denn.
Miri
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 657


Delphi 3 Prof., Delphi 2005 PE
BeitragVerfasst: Do 31.01.08 08:13 
user profile iconrob87 hat folgendes geschrieben:
Hallo,

ich möchte beim BtnClose, also beim Schließen eines Formulares das StringGrid möglichst einfach komplett leeren. Weiß da jemand was?

Oder muss ich des mit der Schleife machen, wo ich einfach überall den Wert '' reinfüll?


:gruebel: Beim schließen?! Geht da nicht eh alles verloren, was man nicht vorher gesichert hat?! :gruebel:

_________________
Anonymes Eckenkind
alzaimar
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2889
Erhaltene Danke: 13

W2000, XP
D6E, BDS2006A, DevExpress
BeitragVerfasst: Do 31.01.08 08:42 
user profile iconMiri hat folgendes geschrieben:
:gruebel: Beim schließen?! Geht da nicht eh alles verloren, was man nicht vorher gesichert hat?! :gruebel:

Äh. Nö. Probier's aus. Das Formular wird beim 'Close' nicht zerstört.

_________________
Na denn, dann. Bis dann, denn.


Zuletzt bearbeitet von alzaimar am Do 31.01.08 08:52, insgesamt 1-mal bearbeitet
Miri
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 657


Delphi 3 Prof., Delphi 2005 PE
BeitragVerfasst: Do 31.01.08 08:48 
Okay, dann hab ich nichts gesagt :mrgreen:

_________________
Anonymes Eckenkind