Buena tarde, jóvenes y jóvenas ilustres de Club Delphi...
Les platico el caso. Tengo una forma que contiene un TScrollBox, y que será llenada con TLabel's y TRadioButton's de acuerdo al contenido de un TADOQuery. Tengo éste código en Delphi 6:
Código Delphi
[-] if RecordCount > 0 then
begin
First;
sGrp := FieldByName('C54_GRUPO_STR'
).AsString;
with TLabel.Create
(scrllboxLlenar) do
begin
Left := 0;
Top := iVlrRngln;
AutoSize := False;
Width := scrllboxLlenar.Width
- 4;
Color := StringToColor(
FieldValues['C54_COLOR_FONDO'
]);
Font.Color := StringToColor(FieldValues['C54_COLOR_FUENTE']);
Alignment := taCenter;
Visible := True;
Caption := sGrp;
end;
while NOT Eof
do begin
if FieldByName(
'C54_GRUPO_STR').AsString <> sGrp
then
begin
iVlrRngln := iVlrRngln + 20;
sGrp := FieldByName('C54_GRUPO_STR').AsString; with TLabel.Create(scrllboxLlenar) do begin Left := 0; Top := iVlrRngln; AutoSize := False; Width := scrllboxLlenar.Width - 4; Color := StringToColor(FieldValues['C54_COLOR_FONDO']); Font.Color := StringToColor(FieldValues['C54_COLOR_FUENTE']); Alignment := taCenter;
Visible := True;
Caption := sGrp;
end; end;
Next;
end
; end;
Y aquí es donde viene el "pero" y la raíz del problema. El tal TScrollBox al momento de ser visible en la forma, ¡¡ESTÁ VACÍO!!, o aparenta estarlo. No se ve ninguna de las TLabel's que SUPUESTAMENTE ya fueron creadas y añadidas al TScrollBox a pesar que TODO el código ejecuta perfectamente.
¿Alguna idea, alguna solución que puedan aportarme? Agradeciendo de antemano sus colaboraciones...