Hi,
Move the code out of your login form into the "Program.cs" file.
When your program first starts, you'll create and show the login form as a modal dialog.
As like the below one
static void Main()
{
LoginForm frmLog = new LoginForm();
if (frmLog.ShowDialog() == DialogResult.OK)
{
Application.Run(new Form2());
}
else
{
Application.Exit();
}
}