diff --git a/Source/Interface/DelayedForm.cs b/Source/Interface/DelayedForm.cs index eb7750ba..3c515cc8 100644 --- a/Source/Interface/DelayedForm.cs +++ b/Source/Interface/DelayedForm.cs @@ -25,18 +25,17 @@ using System.Windows.Forms; #endregion +// This Form is a workaround for the slow drawing of the .NET Forms. +// By showing the Form at 0% Opacity it allows the .NET framework to complete +// drawing the Form first, then we set it to 100% Opacity to actually show it. + namespace CodeImp.DoomBuilder.Interface { public class DelayedForm : Form { - #region ================== Variables - + // Variables private Timer formshowtimer; - #endregion - - #region ================== Constructor - // Constructor public DelayedForm() { @@ -45,11 +44,7 @@ namespace CodeImp.DoomBuilder.Interface formshowtimer.Interval = 1; formshowtimer.Tick += new EventHandler(formshowtimer_Tick); } - - #endregion - - #region ================== Methods - + // When form is shown protected override void OnShown(EventArgs e) { @@ -61,7 +56,7 @@ namespace CodeImp.DoomBuilder.Interface } // When the form is to be shown - void formshowtimer_Tick(object sender, EventArgs e) + private void formshowtimer_Tick(object sender, EventArgs e) { // Get rid of the timer formshowtimer.Dispose(); @@ -70,7 +65,5 @@ namespace CodeImp.DoomBuilder.Interface // Make the form visible this.Opacity = 100; } - - #endregion } } diff --git a/Source/Interface/MainForm.Designer.cs b/Source/Interface/MainForm.Designer.cs index c27ef8bd..de285f24 100644 --- a/Source/Interface/MainForm.Designer.cs +++ b/Source/Interface/MainForm.Designer.cs @@ -231,7 +231,6 @@ namespace CodeImp.DoomBuilder.Interface this.KeyPreview = true; this.MainMenuStrip = this.menumain; this.Name = "MainForm"; - this.Opacity = 0; this.StartPosition = System.Windows.Forms.FormStartPosition.Manual; this.Text = "Doom Builder"; this.Resize += new System.EventHandler(this.MainForm_Resize); diff --git a/Source/Interface/MainForm.cs b/Source/Interface/MainForm.cs index 7650156b..a04c419e 100644 --- a/Source/Interface/MainForm.cs +++ b/Source/Interface/MainForm.cs @@ -28,7 +28,7 @@ using CodeImp.DoomBuilder.Controls; namespace CodeImp.DoomBuilder.Interface { - public partial class MainForm : DelayedForm + public partial class MainForm : Form { #region ================== Constants diff --git a/Source/Interface/MainForm.resx b/Source/Interface/MainForm.resx index 5b98b04e..9598dc33 100644 --- a/Source/Interface/MainForm.resx +++ b/Source/Interface/MainForm.resx @@ -123,12 +123,12 @@ 17, 17 - - True - 121, 17 + + True + True