public GuiLogger() { form = new LogForm(); form.FormClosing += delegate(object sender, FormClosingEventArgs e) { form.Clear(); form.Hide(); e.Cancel = true; }; NewLogEntry += OnNewLogEntry; }