Buenas a todos.
Vamos a ver, espero que me puedan ayudar. Mi problema es el siguiente:
Me creo en tiempo de ejecución unos groupboxs y después de haberlos creados (que lo hace bien) intento crear dentro de cada uno de ellos un determinado número de tFloatEdits (dependen de un length de un array).
El problema lo tengo al crear los floatEdits porque no puedo ponerle como parent el groupbox correspondiente porque no se guardar su nombre. Os adjunto el código para que me puedan echar un cable ok?
////////////////////////////////////////////////////////////////////////////////
Código Delphi
[-]procedure TFormVerServiciosMensual.CreateFloatEdit1a16(aryServicios: TDArrayString);
var
myAryServicios, myParent, listGB1a16Name: TDArrayString;
i, j, k, topX, leftX, topXEdit : integer;
parentAux: string;
WidgetName : TComponent;
begin
BfFormDestroy(Self, P1a16);
myAryServicios := aryServicios;
leftX := 1;
for i:=1 to 16 do
begin
WidgetName := TGroupBox.Create(Self);
with TGroupBox(WidgetName) do
begin
Name := 'GB'+ intToStr(i);
Caption := ' '+inttoStr(i)+' ';
Parent := P1a16; Left := leftX;
Top := 1;
Width := 53;
Height := 192;
end;
leftX := leftX + 53;
for j:=0 to length(myAryServicios)-1 do
begin
with TFloatEdit.Create(Self) do
begin
Name := 'FloatEdit'+ intToStr(i)+intToStr(j);
Hint := myAryServicios[i];
Parent := TGroupBox(WidgetName);
Left := 6;
Top := topXEdit;
Font.Size := 8;
Width := Width + 4;
end;
topXEdit := topXEdit + 35;
end;
end;
end;
////////////////////////////////////////////////////////////////////////////////
Gracias de antemano a todo el foro.
Pd.- Espero haberme explicado bien.