c# how to close a window code example Example 1: c# close window Application.Exit(); Example 2: c# window instantly close System.Console.ReadLine();