private void FormMain_FormClosed(object sender, FormClosedEventArgs e) { MessagePipe.RemoveListner("FormMain"); if (textBoxRootFolder.Text != defaultRootPath) { Settings.Default.RootFolder = textBoxRootFolder.Text; Settings.Default.Save(); } }