// Collection of code snippets by Arne Vajhøj // (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) using System; using System.Threading; using System.Drawing; using System.Windows.Forms; namespace DefaultNamespace { public class MainForm : Form { public MainForm() { InitializeComponent(); } private static void Open() { Application.Run(new MainForm()); } private static void CloseAndOpen() { for(;;) { Thread.Sleep(3000); Application.Exit(); Thread.Sleep(1000); (new Thread(new ThreadStart(Open))).Start(); } } [STAThread] public static void Main(string[] args) { (new Thread(new ThreadStart(CloseAndOpen))).Start(); (new Thread(new ThreadStart(Open))).Start(); } private void InitializeComponent() { AutoScaleBaseSize = new Size(5, 10); ClientSize = new Size(300, 275); Text = "MainForm"; Name = "MainForm"; } } }