This is obious that when you will call this.Close() it will close the Form1 and execution will return to Program.cs Main(). There can be a solution. Change your Program.cs
namespace TestWindowApp
{
static class Program
{
public static bool SetForm2 = false;
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
if (SetForm2)
{
Form2 frm = new Form2();
frm.ShowDialog();
}
}
}
}
And set SetForm2=true wherever you want to close the current form and want to open Form2(Enquiry).
Program.SetForm2 = true;
this.Close();