private void BtnCancel_Click(object sender, EventArgs e) { bool isFinish = CbToastUseFlg.Checked ? OriginMBox.MBoxInfoOKCancel(AppConst.TOAST_USEFLG_ON + AppConst.TOAST_FINISH) == DialogResult.OK : OriginMBox.MBoxInfoOKCancel(AppConst.TOAST_USEFLG_OFF + AppConst.TOAST_FINISH) == DialogResult.OK; if (isFinish) { //DB更新 Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None); int userId = int.Parse(config.AppSettings.Settings["UserId"].Value); ConfigurationSetting.UpdateConfigSettingFromToast(userId, CbToastUseFlg.Checked); Close(); } }