Ver Mensaje Individual
  #10  
Antiguo 25-10-2018
juniorSoft juniorSoft is offline
Miembro
 
Registrado: abr 2005
Posts: 178
Reputación: 20
juniorSoft Va por buen camino
Puedes probar algo como esto para no utilizar el método FindComponent
Código Delphi [-]
Const
    max = 10;
type
   TArrEdits = array[1..max, 1..max] of TEdit;

procedure CrearEdits(Edits:TArrEdits);
var
   I, J:integer;
begin
   Button1.Visible := False;
    for i:=1 to max do
        for J:=1 to max do
            begin
               Edits[I, J] := TEdit.Create(Self);
               Edits[I, J] .Text := '';
               Edits[I, J] .Top := 21 * (i + 1);
               Edits[I, J] .Left := 21 * (j + 1);
               Edits[I, J] .Width := 20;
               Edits[I, J] .Height := 20;
               Edits[I, J] .AutoSize := False;
               Edits[I, J] .Enabled := False;
               Edits[I, J] .Parent := Panel1;
               Button3.Visible := True;
            end;
end;

procedure llenarEdits(Edits:TArrEdits);
var
  I, J:integer;

begin
       for i:=1 to max do
        for J:=1 to max do
            begin
                Edits[I, J].text :=IntToStr(Random(100));
           end;
end;

procedure TForm1.Button1Click(Sender: TObject);
var
  ArrEdits:TArrEdits;
begin
   CrearEdits(ArrEdits);
   llenarEdits(ArrEdits);
end;

Última edición por Casimiro Notevi fecha: 25-10-2018 a las 08:37:52.
Responder Con Cita