in my application i have two forms let's say, LoginForm and AccountForm
The LoginForm is set as the main Form, it is the form when the user is able to login from to his account ( two TEdits and login Button ). When a user type his login details and connect, a new form which is AccountForm is opened.
How to close the LoginForm on login success without closing the whole application? or in such language how to use the code below to close the Login form only but not the application.
if (not IncludeForm.sqlquery1.IsEmpty) and (isblacklisted='0') and (isactivated='1') then
begin // Login Successful *** Show the account window
AccountForm.Show;
LoginFrom.Close; // <----The problem is in this line, using this line causes the whole application to close***}
end;
Thankyou
You can fetch here the source code of the excellent article Display a LogIn / Password Dialog Before the Main Form is Created by Zarko Gajic .
Excerpt: