Hi, I have a little problem with my simple login system. this is the code
static class Program
{
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
bool loginSuccessful;
bool loginRetry;
using (Login login = new Login())
{
loginSuccessful = (login.ShowDialog() == DialogResult.OK);
loginRetry = (login.ShowDialog() == DialogResult.Retry);
if (loginSuccessful)
{
Application.Run(new Form1());
}
if (loginRetry)
{
Application.Run(new Login());
}
}
}
}
It works but a little problem starts with these two lines :
loginSuccessful = (login.ShowDialog() == DialogResult.OK);
loginRetry = (login.ShowDialog() == DialogResult.Retry);
At firts the programm reaches the 'loginSuccessful-line', but when it reaches the next line the windows forms application starts to move from its position and waits for a new click on the login button before it decides to close itself and to move on the the next forms application or to stay at its place because of a wrong usercode/password combination.
how can I fix this ? Btw. this is .net, C# I dont want the forms application to move 1 position from left to right and ask for a new click action.