private void ImgRadioButton_CheckedChanged(object sender, EventArgs e) { if (imgRadioButton.Checked && imgRadioButton.Enabled) { if ((bool)UserConfigManager.GetConfigValueByKey(ConfigKey.IsImgInfoRemind)) { FirstForm_ImgCheckInfo firstForm_ImgCheckInfo = new FirstForm_ImgCheckInfo(); firstForm_ImgCheckInfo.StartPosition = FormStartPosition.Manual; //手動設定跳窗初始位置 firstForm_ImgCheckInfo.Location = new Point(this.Location.X + this.Size.Width / 4, this.Location.Y + this.Size.Height / 4); //跳窗位置 DialogResult dontRemindImgInto = firstForm_ImgCheckInfo.ShowDialog(); bool NoNeedToRemind; if (dontRemindImgInto == DialogResult.Yes) { NoNeedToRemind = true; } else { NoNeedToRemind = false; } UserConfigManager.SetAndWriteConfig(ConfigKey.IsImgInfoRemind, !NoNeedToRemind); } } }
//依照使用者設定初始化整個版面 private void SettingFirstFormByConfig() { urlCheckBox.Checked = (bool)UserConfigManager.GetConfigValueByKey(ConfigKey.UseUrl); //根據有沒有check來變換其他控制項之Enable UrlCheckBox_CheckedChanged(this, new EventArgs()); youtubeRadioButton.Checked = (bool)UserConfigManager.GetConfigValueByKey(ConfigKey.IsYouTubeChecked); imgRadioButton.Checked = !(bool)UserConfigManager.GetConfigValueByKey(ConfigKey.IsYouTubeChecked); rightSideRadioButton.Checked = (bool)UserConfigManager.GetConfigValueByKey(ConfigKey.IsPreViewAtRight); downRadioButton.Checked = !(bool)UserConfigManager.GetConfigValueByKey(ConfigKey.IsPreViewAtRight); //Proview向上偏移 UpDownOffsetUp.Value = (int)UserConfigManager.GetConfigValueByKey(ConfigKey.UpOffet); zoomComboBox.Text = UserConfigManager.GetConfigValueByKey(ConfigKey.ZoomPercentage).ToString() + "%"; sourcePreviewCheckBox.Checked = (bool)UserConfigManager.GetConfigValueByKey(ConfigKey.IsBeforePreviewChecked); resultPreviewCheckBox.Checked = (bool)UserConfigManager.GetConfigValueByKey(ConfigKey.IsAfterPreviewChecked); centerCheckBox.Checked = (bool)UserConfigManager.GetConfigValueByKey(ConfigKey.IsCenterChecked); }