password texboxes and two buttons login and
cancel.these button handlers sets the DialogResult
property for the form.here login button sets it to
DialogResult.Ok and cancel button sets it to
DialogResult.Cancel.
the main program.cs file does all as follows -
static class Program
{
private static FormSplash formSplashObj = null;
[STAThread]
static void Main()
{
//Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
formSplashObj = new FormSplash();
Application.Run(formSplashObj);
if (formSplashObj.DialogResult == DialogResult.OK)
{
Application.Run(new MainForm());
}
}
}
the above program responsible for running the splash
form and when it quit, the program determines
whether it will exit the application or run next form.
so this provide a login for the application.