Ahora me he fijado en los procedimientos de creación y la verdad es que son "un poco raros"
.
Primero creas el objeto y asignas propiedades y luego lo vuelves a crear (Create).
Creo que en el segundo paso estás intentando asignar el objeto a la variable, pero al volver a llamar al create, lo que estás haciendo es crear uno nuevo y perder lo que has hecho anteriormente.
Código Delphi
[-]
with TDriveComboBox.Create(self) do
begin
parent:= Pariente;
top:= 15;
left:= 15;
OnClick:= UnidadesClick;
OnChange:= UnidadesChange;
DirList:= ListaCarpetas;
end;
Unidades:= TDriveComboBox.Create(nil);
Prueba con algo así:
Código Delphi
[-]
procedure TFCopiaSeguridad.crearUnidades (Pariente : TWinControl);
begin
Unidades:= TDriveComboBox.Create(Self);
with Unidades do
begin
parent:= Pariente;
top:= 15;
left:= 15;
OnClick:= UnidadesClick;
OnChange:= UnidadesChange;
DirList:= ListaCarpetas;
end;
end;
procedure TFCopiaSeguridad.crearDirectorio (Pariente : TWinControl);
begin
ListaCarpetas:= TDirectoryListBox.Create(Self);
with ListaCarpetas do
begin
parent:= Pariente;
top:= 40;
left:= 15;
ItemHeight:= 16;
TabOrder:= 1;
OnChange:= ListaCarpetasChange;
end;
end;
Que no se si es lo que querías hacer.