void Device_Menu(object sender, EventArgs e) { var dlg = new SettingsDialog(Settings.Default); if (dlg.ShowDialog() == DialogResult.OK) { Settings.Default.Save(); // if settings changed, enter new chatroom if ((_chatRoom != null) && (_chatRoom.Channel != Settings.Default.Channel || _chatRoom.Username != Settings.Default.Username || _chatRoom.Password != Settings.Default.Password)) { _chatRoom.Dispose(); EnterChatroom(); } } }