Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 11th, 2012  |  syntax: None  |  size: 0.85 KB  |  hits: 9  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Closing Form In C# [closed]
  2. AMBR A = new AMBR();
  3. this.Close();
  4. A.Show();
  5.        
  6. static class Program
  7. {
  8.     private static EventHandler idleTemp;
  9.     private static SplashFrm splash;
  10.  
  11.  
  12.     /// <summary>
  13.     /// The main entry point for the application.
  14.     /// </summary>
  15.     [STAThread]
  16.     static void Main()
  17.     {
  18.         Application.EnableVisualStyles();
  19.         Application.SetCompatibleTextRenderingDefault(false);
  20.         splash = new SplashFrm();
  21.         splash.Show();
  22.         idleTemp = new EventHandler(Application_Idle);
  23.         Application.Idle += idleTemp;
  24.  
  25.         Application.Run(new AMBR());
  26.     }
  27.  
  28.     static void Application_Idle(object sender, EventArgs e)
  29.     {
  30.         splash.Close();
  31.         Application.Idle -= idleTemp;
  32.         idleTemp = null;
  33.         splash = null;
  34.     }
  35. }
  36.        
  37. this.Hide();
  38.        
  39. this.Visible = false;
  40.  
  41. //Show the second form