private void MainWindow_Closed(object sender, EventArgs e) { this.sp売上明細データ.InputBindings.Clear(); this.売上明細データ = null; if (ucfg != null) { if (frmcfg == null) { frmcfg = new ConfigDLY16010(); } frmcfg.Top = this.Top; frmcfg.Left = this.Left; frmcfg.Width = this.Width; frmcfg.Height = this.Height; frmcfg.表示順 = this.表示順; frmcfg.表示順方向 = this.表示順方向; frmcfg.区分1 = this.Cmb_検索日付.SelectedIndex; frmcfg.集計期間From = this.検索日付From; frmcfg.集計期間To = this.検索日付To; frmcfg.spConfig20180118 = AppCommon.SaveSpConfig(this.sp売上明細データ); ucfg.SetConfigValue(frmcfg); } }
/// <summary> /// 画面読み込み /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void MainWindow_Loaded_1(object sender, RoutedEventArgs e) { // 初期状態を保存(SPREADリセット時にのみ使用する) this.sp_Config = AppCommon.SaveSpConfig(this.sp売上明細データ); //F1(検索)機能 base.MasterMaintenanceWindowList.Add("M01_TOK", new List <Type> { null, typeof(SCH01010) }); base.MasterMaintenanceWindowList.Add("M72_TNT", new List <Type> { null, typeof(SCH23010) }); AppCommon.SetutpComboboxList(this.Cmb_検索日付, false); AppCommon.SetutpComboboxList(this.c入金区分, false); #region 設定項目取得 ucfg = AppCommon.GetConfig(this); frmcfg = (ConfigDLY16010)ucfg.GetConfigValue(typeof(ConfigDLY16010)); if (frmcfg == null) { frmcfg = new ConfigDLY16010(); ucfg.SetConfigValue(frmcfg); frmcfg.spConfig20180118 = this.sp_Config; } else { //表示できるかチェック var WidthCHK = System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width - frmcfg.Left; if (WidthCHK > 10) { this.Left = frmcfg.Left; } //表示できるかチェック var HeightCHK = System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height - frmcfg.Top; if (HeightCHK > 10) { this.Top = frmcfg.Top; } this.Height = frmcfg.Height; this.Width = frmcfg.Width; this.Cmb_検索日付.SelectedIndex = frmcfg.区分1; this.検索日付From = frmcfg.集計期間From; this.検索日付To = frmcfg.集計期間To; } #endregion AppCommon.LoadSpConfig(this.sp売上明細データ, frmcfg.spConfig20180118 != null ? frmcfg.spConfig20180118 : this.sp_Config); sp売上明細データ.InputBindings.Add(new KeyBinding(sp売上明細データ.NavigationCommands.MoveNext, Key.Enter, ModifierKeys.None)); ButtonCellType btn = this.sp売上明細データ.Columns[0].CellType as ButtonCellType; btn.Command = new cmd売上詳細表示(sp売上明細データ); //ComboBoxに値を設定する GetComboBoxItems(); sp売上明細データ.RowCount = 0; if (frmcfg.表示順 != null) { if (frmcfg.表示順.Length == 5) { this.表示順 = frmcfg.表示順; } } if (frmcfg.表示順方向 != null) { if (frmcfg.表示順方向.Length == 5) { this.表示順方向 = frmcfg.表示順方向; } } this.textbox検索日付From.SetFocus(); }