/// <summary> /// Loadイベント /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Window_Loaded_1(object sender, RoutedEventArgs e) { #region 設定項目取得 ucfg = AppCommon.GetConfig(this); frmcfg = (ConfigMST01010_1)ucfg.GetConfigValue(typeof(ConfigMST01010_1)); if (frmcfg == null) { frmcfg = new ConfigMST01010_1(); ucfg.SetConfigValue(frmcfg); } 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 }
//画面が閉じられた時、データを保持する private void Window_Closed(object sender, EventArgs e) { if (ucfg != null) { if (frmcfg == null) { frmcfg = new ConfigMST01010_1(); } frmcfg.Top = this.Top; frmcfg.Left = this.Left; frmcfg.Width = this.Width; frmcfg.Height = this.Height; ucfg.SetConfigValue(frmcfg); } }