Resolvido... Criei uma nova Unit para colocar as 'funções'. o código fico +/- isso.. Unit = unit Gr_funcoes;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, DB, ADODB, Grids, Menus;
procedure CriaStringGrid(Cod, Esq, Cima: Integer; l_janela : TWincontrol);
implementation
uses Index,Form2;
procedure CriaStringGrid(Cod, Esq, Cima: Integer; l_janela : TWincontrol);
begin
SG[Cod] := TStringGrid.Create(l_janela);
SG[Cod].Parent := l_janela;
SG[Cod].ColCount := 3;
SG[Cod].Name := 'sg_' + IntToStr(Cod);
SG[Cod].Left := Esq;
SG[Cod].Top := Cima - 100;
SG[Cod].Height := 140;
SG[Cod].Width := 178;
SG[Cod].FixedCols := 0;
SG[Cod].Cells[0,0] := 'CÓD';
SG[Cod].Cells[1,0] := 'DIA';
SG[Cod].Cells[2,0] := 'JOGO';
SG[Cod].ColWidths[0]:= 30;
SG[Cod].ColWidths[1]:= 30;
SG[Cod].ColWidths[2]:= 95;
//--------- Cria a Descrição da Tabela...
TL[Cod] := TLabel.Create(l_janela);
TL[Cod].Parent := l_janela;
TL[Cod].Name := 'tl_' + IntToStr(Cod);
TL[Cod].Left := Esq;
TL[Cod].Top := Cima-118;
TL[Cod].Width := 178;
TL[Cod].Height := 18;
end;
end.
Form2 =
procedure TFomr2.FormCreate(Sender: TObject);
Var
x : Integer;
Begin
l_localY := 180;
FOR x := 1 TO 10 DO BEGIN
l_localX := l_localX + 6;
CriaStringGrid(x, l_localX, l_localY,SELF);
l_localX := l_localX + 181;
IF x MOD 5 = 0 THEN BEGIN
l_localY := l_localY + 180;
l_localX := 0;
END;
END;