You can run your Logon form firt in Main event. Here is an example:
private static bool StateLogIn = true;
private static void Main()
{
// main form
MainForm thisForm = new MainForm();
// login form
Login frmLogin = new Login();
// show login form first, force user to logged on system
frmLogin.ShowDialog();
if (StateLogIn)
{
StateLogIn = false;
if (frmLogin.DialogResult == DialogResult.OK)
{
Application.Run(thisForm);
}
else
{
Application.Exit();
}
}
else
{
if (frmLogin.DialogResult == DialogResult.OK)
{
thisForm.Visible = true;
}
}
}
"NiGhTmArE" wrote:
hi there
i'm new to c sharp and i would like to learn more about it and
design the first form LOGIN so that i put admin user and pasword
i tried everything with no luck so i come here to get some help from
you guys
thanks