Here is my code to display a confirmation form which has two buttons, one named AcceptButton with ModalResult set to mrOK and the other named CancelButton with ModalResult set to mrCancel. Both buttons have Close in their OnClick event. No matter which button I click when the Confirm_Form is displayed, the following function returns Result=False. I cannot figure out for the life of me what I'm missing.
function TForm1.ConfirmNewProject(DName: String): Boolean;
var
f: TConfirm_Form;
begin
f := TConfirm_Form.Create(Self);
f.Label2.Caption := DName;
try
if f.ShowModal = mrOk then Result := True
else Result := False;
finally
f.Release;
end;
end;