//画面が閉じられた時、データを保持する private void MainWindow_Closed(object sender, EventArgs e) { if (ucfg != null) { if (frmcfg == null) { frmcfg = new ConfigDLY11010(); } frmcfg.Top = this.Top; frmcfg.Left = this.Left; frmcfg.Width = this.Width; frmcfg.Height = this.Height; ucfg.SetConfigValue(frmcfg); } }
/// <summary> /// 画面読み込み /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void MainWindow_Loaded(object sender, RoutedEventArgs e) { #region 設定項目取得 ucfg = AppCommon.GetConfig(this); frmcfg = (ConfigDLY11010)ucfg.GetConfigValue(typeof(ConfigDLY11010)); //20190919 add-s CB 軽減税率対応 // 権限設定を呼び出す(ucfgを取得した後のに入れる) ccfg = (CommonConfig)ucfg.GetConfigValue(typeof(CommonConfig)); //20190919 add-e CB 軽減税率対応 if (frmcfg == null) { frmcfg = new ConfigDLY11010(); 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.Width = frmcfg.Width; this.Height = frmcfg.Height; } #endregion // 検索画面情報を設定 base.MasterMaintenanceWindowList.Add("M01_TOK", new List <Type> { typeof(MST01010), typeof(SCHM01_TOK) }); // 初期値設定 txt売上日From.Text = DateTime.Now.ToString("yyyy/MM/dd"); txt売上日To.Text = DateTime.Now.ToString("yyyy/MM/dd"); SetFocusToTopControl(); }