home *** CD-ROM | disk | FTP | other *** search
/ Programming in Microsoft Windows with C# / Programacion en Microsoft Windows con C#.iso / Original Code / Hello Windows Forms / TwoForms / TwoForms.cs next >
Encoding:
Text File  |  2001-01-15  |  619 b   |  24 lines

  1. //---------------------------------------
  2. // TwoForms.cs ⌐ 2001 by Charles Petzold
  3. //---------------------------------------
  4. using System.Windows.Forms;
  5.  
  6. class TwoForms
  7. {
  8.      public static void Main()
  9.      {
  10.           Form form1 = new Form();
  11.           Form form2 = new Form();
  12.  
  13.           form1.Text = "Form passed to Run()";
  14.           form2.Text = "Second form";
  15.           form2.Show();
  16.  
  17.           Application.Run(form1);
  18.  
  19.           MessageBox.Show("Application.Run() has returned " +
  20.                           "control back to Main. Bye, bye!",
  21.                           "TwoForms");
  22.      }
  23. }
  24.