Hello,
Solution1:
Simple way to do this is to hide the login form.
private void button1_Click(object sender, EventArgs e)
{
Form2 obj = new Form2();
obj.Show();
this.Hide();
}
Solution 2:
Modify Program.cs file
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
if (new Login().ShowDialog() != DialogResult.OK)
{
Application.Run(new Form2());
}
}
}
Hope this will help you...
Thanks!!!