diff --git a/Source/GrasscutterTools/Forms/FormMain.cs b/Source/GrasscutterTools/Forms/FormMain.cs
index d92dd78..55286b9 100644
--- a/Source/GrasscutterTools/Forms/FormMain.cs
+++ b/Source/GrasscutterTools/Forms/FormMain.cs
@@ -41,10 +41,33 @@ namespace GrasscutterTools.Forms
Icon = Resources.IconGrasscutter;
if (DesignMode) return;
- // 初始化页面
- InitPages();
- // 加载设置
- LoadSettings();
+
+ try
+ {
+ // 还原窗体位置
+ if (Settings.Default.MainFormLocation != default)
+ {
+ StartPosition = FormStartPosition.Manual;
+ Location = Settings.Default.MainFormLocation;
+ Console.WriteLine("Restore window location: " + Location.ToString());
+ }
+
+ // 还原窗体大小
+ if (Settings.Default.MainFormSize != default)
+ {
+ Size = Settings.Default.MainFormSize;
+ Console.WriteLine("Restore window size: " + Size.ToString());
+ }
+
+ // 初始化页面
+ InitPages();
+ // 恢复自动复制选项状态
+ ChkAutoCopy.Checked = Settings.Default.AutoCopy;
+ }
+ catch (Exception ex)
+ {
+ MessageBox.Show(Resources.SettingLoadError + ex.Message, Resources.Error, MessageBoxButtons.OK, MessageBoxIcon.Error);
+ }
Console.WriteLine("FormMain ctor completed");
}
@@ -93,22 +116,6 @@ namespace GrasscutterTools.Forms
return page;
}
- ///
- /// 载入设置
- ///
- private void LoadSettings()
- {
- try
- {
- // 恢复自动复制选项状态
- ChkAutoCopy.Checked = Settings.Default.AutoCopy;
- }
- catch (Exception ex)
- {
- MessageBox.Show(Resources.SettingLoadError + ex.Message, Resources.Error, MessageBoxButtons.OK, MessageBoxIcon.Error);
- }
- }
-
///
/// 窗体载入时触发(切换语言时会重新载入)
///
@@ -131,26 +138,6 @@ namespace GrasscutterTools.Forms
}
}
- ///
- /// 第一次显示窗体时触发
- ///
- protected override void OnShown(EventArgs e)
- {
- base.OnShown(e);
- // 还原窗体位置
- if (Settings.Default.MainFormLocation != default)
- {
- Location = Settings.Default.MainFormLocation;
- Console.WriteLine("Restore window location: " + Location.ToString());
- }
- // 还原窗体大小
- if (Settings.Default.MainFormSize != default)
- {
- Size = Settings.Default.MainFormSize;
- Console.WriteLine("Restore window size: " + Size.ToString());
- }
- }
-
///
/// 窗口关闭后触发
///