/// <summary> /// 画面読み込み /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void MainWindow_Loaded(object sender, RoutedEventArgs e) { // 初期状態を保存(SPREADリセット時にのみ使用する) this.sp_Config = AppCommon.SaveSpConfig(this.spGridList); base.MasterMaintenanceWindowList.Add("M70_JIS", new List <Type> { typeof(MST16010), typeof(SCHM70_JIS) }); #region 設定項目取得 ucfg = AppCommon.GetConfig(this); ccfg = (CommonConfig)ucfg.GetConfigValue(typeof(CommonConfig)); frmcfg = (ConfigMST01011)ucfg.GetConfigValue(typeof(ConfigMST01011)); if (frmcfg == null) { frmcfg = new ConfigMST01011(); ucfg.SetConfigValue(frmcfg); frmcfg.spConfig20180118 = this.sp_Config; } else { // 表示できるかチェック var WidthCHK = WinForms.Screen.PrimaryScreen.Bounds.Width - frmcfg.Left; if (WidthCHK > 10) { this.Left = frmcfg.Left; } // 表示できるかチェック var HeightCHK = WinForms.Screen.PrimaryScreen.Bounds.Height - frmcfg.Top; if (HeightCHK > 10) { this.Top = frmcfg.Top; } this.Height = frmcfg.Height; this.Width = frmcfg.Width; } #endregion spGridList.InputBindings.Add(new KeyBinding(spGridList.NavigationCommands.MoveNext, Key.Enter, ModifierKeys.None)); ScreenClear(); // コントロールの初期設定をおこなう //initSearchControl(); spGridList.RowCount = 0; SetFocusToTopControl(); ErrorMessage = ""; }
private void MainWindow_Closed(object sender, EventArgs e) { this.spGridList.InputBindings.Clear(); this.SearchResult = null; if (ucfg != null) { if (frmcfg == null) { frmcfg = new ConfigMST01011(); } frmcfg.Top = this.Top; frmcfg.Left = this.Left; frmcfg.Width = this.Width; frmcfg.Height = this.Height; frmcfg.spConfig20180118 = AppCommon.SaveSpConfig(this.spGridList); ucfg.SetConfigValue(frmcfg); } }