From 436f625edfb404f817fc937813553dd67bf4bec0 Mon Sep 17 00:00:00 2001 From: dontpanic Date: Fri, 10 Jan 2020 14:29:32 +0800 Subject: [PATCH] Move initialization of controls into constructor --- Dotnvim/Form1.cs | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/Dotnvim/Form1.cs b/Dotnvim/Form1.cs index 854a863..170912a 100644 --- a/Dotnvim/Form1.cs +++ b/Dotnvim/Form1.cs @@ -65,6 +65,14 @@ public Form1() } } } + + this.InitializeControls(); + this.BlurBehind(Color.FromArgb(255, 255, 255, 255), Properties.Settings.Default.BackgroundOpacity, Properties.Settings.Default.BlurType); + + var dwmBorderSize = Helpers.GetPixelSize(new Size2F(DwmBorderSize, DwmBorderSize), this.renderer.Dpi); + NativeInterop.Methods.ExtendFrame(this.Handle, dwmBorderSize.Width, dwmBorderSize.Height); + + Properties.Settings.Default.PropertyChanged += this.Default_PropertyChanged; } /// @@ -187,16 +195,6 @@ protected override void OnLoad(EventArgs e) // Load window size and state this.Size = Properties.WindowState.Default.WindowSize; this.WindowState = Properties.WindowState.Default.IsMaximized ? FormWindowState.Maximized : FormWindowState.Normal; - - this.InitializeControls(); - - this.BlurBehind(Color.FromArgb(255, 255, 255, 255), Properties.Settings.Default.BackgroundOpacity, Properties.Settings.Default.BlurType); - - var dwmBorderSize = Helpers.GetPixelSize(new Size2F(DwmBorderSize, DwmBorderSize), this.renderer.Dpi); - NativeInterop.Methods.ExtendFrame(this.Handle, dwmBorderSize.Width, dwmBorderSize.Height); - - Properties.Settings.Default.PropertyChanged += this.Default_PropertyChanged; - this.OnResize(); }