The difference between Form.Show and Application.Run() : Form : GUI Windows Forms C# Examples


C# Examples » GUI Windows Forms » Form »

 

The difference between Form.Show and Application.Run()









    
using  System.Windows.Forms;
      
class  TwoForms
{
          public  static  void  Main()
          {
                    Form  form1  =  new  Form();
                    Form  form2  =  new  Form();
      
                    form1.Text  =  "Form  passed  to  Run()";
                    form2.Text  =  "Second  form";
                    form2.Show();
      
                    Application.Run(form1);
      
                    MessageBox.Show("Application.Run()  has  returned  control  back  to  Main.","TwoForms");
          }
}
    
   
  
   




HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo GUI Windows Forms
» Form