I am doing an application a Windows Form application. At first, a certain form appears, and after the user hits the next button, this form should be hidden and another form
Anything after Application.Run( ) will only be executed when the main form closes.
What you could do is handle the VisibleChanged event as follows:
static Form1 form1;
static Form2 form2;
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
form2 = new Form2();
form1 = new Form1();
form2.Hide();
form1.VisibleChanged += OnForm1Changed;
Application.Run(form1);
}
static void OnForm1Changed( object sender, EventArgs args )
{
if ( !form1.Visible )
{
form2.Show( );
}
}