private void btnOK_Click(object sender, EventArgs e) { var ConfigInstance = StartupConfig.CreateInstance(); if (string.IsNullOrEmpty(ConfigInstance.AppMode)) { if (!string.IsNullOrEmpty(cmbMode.GetItemText(cmbMode.SelectedItem)) && cmbMode.GetItemText(cmbMode.SelectedItem) != "SELECT") { ConfigInstance.AppMode = cmbMode.GetItemText(cmbMode.SelectedItem); this.Close(); if (ConfigInstance.AppMode == "SERVER") { Server.ServerStartupForm obj = new Server.ServerStartupForm(); obj.Show(); } else if (ConfigInstance.AppMode == "CLIENT") { Client.ClentStartupFrom obj = new Client.ClentStartupFrom(); obj.Show(); } setting.WriteApplicationMode(ConfigInstance.AppMode); } } }