When I open my form for the first time I get no violation, but when I first select a TEdit field and then close the form and then recreate the form and open it I get the Violation.
Code for creating the form:
procedure TfrmNocoreDKS.actConfigExecute(Sender: TObject);
var
confForm: TConfiguratie;
begin
confForm := TConfiguratie.Create(nil);
confForm.ShowModal(
procedure(ModalResult: TModalResult)
begin
confForm.DisposeOf;//Also tried confForm.Free;
end);
end;
I've also tried this for creating the form:
procedure TfrmNocoreDKS.actConfigExecute(Sender: TObject);
var
confForm: TConfiguratie;
begin
confForm := TConfiguratie.Create(nil);
try
confForm.ShowModal(
procedure(ModalResult: TModalResult)
begin
end);
finally
confForm.free;
end;
end;
Code for Closing the form:
procedure TConfiguratie.FormClose(Sender: TObject; var Action: TCloseAction);
begin
Action := TCloseAction.caFree;
end;
Because the violation only appears when you click on any TEdit and then close the form I think it has something to do with the virtual keyboard, but i'm not sure. I don't have any methods that use the virtual keyboard itself.
Aucun commentaire:
Enregistrer un commentaire