My application has an administration dialog that can be reached via a login dialog (both modal).
On the login dialog, the user enters his password, then clicks ok. In the ok button handler, I am calling Self.Close(), then AdminForm.ShowModal().
The problem is that the LoginForm remains open behind the AdminForm until the call to AdminForm.ShowModal() returns (visible when you move the AdminForm).
Any ideas?
I know I could solve this by showing both forms from a 3rd place, like
LoginForm.ShowModal();
if <check some variable from LoginForm to see if user logged in successfully> then begin
AdminForm.ShowModal()
end;
But I am looking specifically for a solution that works from within the ok button handler in the LoginForm.