é alguma coisa que está faltando fazer no uso do componente.
verifique se está limpando os titulos e reconfigurando
usa o componente estático no form ou datamodule?
sugestão é começar estudar padrões de projeto. escrever algo com interface onde tu constroi um fabrica de componente, configura, usa e ao final ele destroi sozinho
para o proximo cria um novo objeto e assim por diante
algo do tiop segue que pedi ao chatgpt pra criar
unit BoletoFactory;
interface
uses
ACBrBoleto;
type
IBoletoFactory = interface
function CreateBoleto: TACBrBoleto;
end;
implementation
end.
unit MyBoletoFactory;
interface
uses
BoletoFactory, ACBrBoleto;
type
TMyBoletoFactory = class(TInterfacedObject, IBoletoFactory)
function CreateBoleto: TACBrBoleto;
end;
implementation
function TMyBoletoFactory.CreateBoleto: TACBrBoleto;
begin
Result := TACBrBoleto.Create(nil); // Adjust constructor parameters as needed
end;
end.
unit Main;
interface
uses
BoletoFactory, MyBoletoFactory, ACBrBoleto;
type
TMainForm = class(TForm)
// ...
private
FBoletoFactory: IBoletoFactory;
FBoleto: TACBrBoleto;
// ...
public
// ...
end;
implementation
procedure TMainForm.FormCreate(Sender: TObject);
begin
FBoletoFactory := TMyBoletoFactory.Create;
FBoleto := FBoletoFactory.CreateBoleto;
end;
procedure TMainForm.FormDestroy(Sender: TObject);
begin
FBoleto.Free;
end;
end.