Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   GUI-Design mit VCL / FireMonkey / Common Controls (https://www.delphipraxis.net/18-gui-design-mit-vcl-firemonkey-common-controls/)
-   -   Delphi stringgrid columns (https://www.delphipraxis.net/25178-stringgrid-columns.html)

chiveZ 2. Jul 2004 10:34


stringgrid columns
 
hiho
:wink:

ich wollte ma fragn wie man im stringgrid die columns benennen kann
ich hab scho gesucht aba kein anderen thread gefunden

mfg

sakura 2. Jul 2004 10:36

Re: stringgrid columns
 
Weiß meinst Du mit benennen? Erstelle mal ein leeres Projekt, wirf ein StringGrid rein und diesen Code ins OnCreate Ereignis Deines Forms. Das sollte helfen ;)

Delphi-Quellcode:
procedure TForm1.FormCreate(Sender: TObject);
var
  _Col, _Row: Integer;
begin
  with StringGrid1 do
  begin
    RowCount := 9;
    ColCount := 9;
    FixedCols := 2;
    FixedRows := 1;
    for _Col := 0 to Pred(ColCount) do
    for _Row := 0 to Pred(RowCount) do
      Cells[_Col, _Row] := Format('[%d, %d]', [_Col, _Row]);
  end;
end;
...:cat:...

chiveZ 2. Jul 2004 10:57

Re: stringgrid columns
 
hmmm... sieht schoma net schlecht aus :thuimb:

mit benennen meine ich die überschrift (bei DBGrid heisst das columns)
der einzelnen spalten also sozusagen nach deiner source die
grau hinterlegten felder [0,0] , [1,0] , [2,0] ,[3,0] ....

Sharky 2. Jul 2004 11:02

Re: stringgrid columns
 
Zitat:

Zitat von chiveZ
...mit benennen meine ich die überschrift ....

Einfach reinschreiben ;-)
Delphi-Quellcode:
procedure TForm1.Button1Click(Sender: TObject);
begin
  with StringGrid1 do
  begin
    Cells[1,0] := 'Spalte 1';
    Cells[2,0] := 'Spalte 2';
    Cells[3,0] := 'Spalte 3';
  end;
end;

chiveZ 2. Jul 2004 11:06

Re: stringgrid columns
 
jo thx :hello: :hello:
hat geklappt


Alle Zeitangaben in WEZ +1. Es ist jetzt 09:19 Uhr.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz