mirror of
https://github.com/terrymacdonald/DisplayMagician.git
synced 2024-08-30 18:32:20 +00:00
Adjusted MainForm logic so it loads top most window
Now that we load a splashscreen, I've had to adjust the MainForm window display logic so that it goes to the topmost window when the user requests it to. This is much easier to use.
This commit is contained in:
parent
913cf34d72
commit
9cdb1cb3f2
@ -26,8 +26,8 @@ using System.Resources;
|
|||||||
[assembly: Guid("e4ceaf5e-ad01-4695-b179-31168eb74c48")]
|
[assembly: Guid("e4ceaf5e-ad01-4695-b179-31168eb74c48")]
|
||||||
|
|
||||||
// Version information
|
// Version information
|
||||||
[assembly: AssemblyVersion("2.1.0.57")]
|
[assembly: AssemblyVersion("2.1.0.59")]
|
||||||
[assembly: AssemblyFileVersion("2.1.0.57")]
|
[assembly: AssemblyFileVersion("2.1.0.59")]
|
||||||
[assembly: NeutralResourcesLanguageAttribute( "en" )]
|
[assembly: NeutralResourcesLanguageAttribute( "en" )]
|
||||||
[assembly: CLSCompliant(true)]
|
[assembly: CLSCompliant(true)]
|
||||||
|
|
||||||
|
@ -125,6 +125,10 @@ namespace DisplayMagician.UIForms
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Shut down the splash screen
|
||||||
|
if (Program.AppProgramSettings.ShowSplashScreen && Program.AppSplashScreen != null && !Program.AppSplashScreen.Disposing && !Program.AppSplashScreen.IsDisposed)
|
||||||
|
Program.AppSplashScreen.Invoke(new Action(() => Program.AppSplashScreen.Close()));
|
||||||
|
|
||||||
if (Program.AppProgramSettings.MinimiseOnStart)
|
if (Program.AppProgramSettings.MinimiseOnStart)
|
||||||
{
|
{
|
||||||
// Make the form minimised on start
|
// Make the form minimised on start
|
||||||
@ -174,10 +178,6 @@ namespace DisplayMagician.UIForms
|
|||||||
cb_minimise_notification_area.Checked = false;
|
cb_minimise_notification_area.Checked = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Shut down the splash screen
|
|
||||||
if (Program.AppProgramSettings.ShowSplashScreen && Program.AppSplashScreen != null && !Program.AppSplashScreen.Disposing && !Program.AppSplashScreen.IsDisposed)
|
|
||||||
Program.AppSplashScreen.Invoke(new Action(() => Program.AppSplashScreen.Close()));
|
|
||||||
|
|
||||||
// If we've been handed a Form of some kind, then open it straight away
|
// If we've been handed a Form of some kind, then open it straight away
|
||||||
if (formToOpen is DisplayProfileForm)
|
if (formToOpen is DisplayProfileForm)
|
||||||
{
|
{
|
||||||
@ -189,6 +189,16 @@ namespace DisplayMagician.UIForms
|
|||||||
var shortcutLibraryForm = new ShortcutLibraryForm();
|
var shortcutLibraryForm = new ShortcutLibraryForm();
|
||||||
shortcutLibraryForm.ShowDialog(this);
|
shortcutLibraryForm.ShowDialog(this);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Make this window top most if we're not minimised
|
||||||
|
if (!Program.AppProgramSettings.MinimiseOnStart)
|
||||||
|
{
|
||||||
|
this.TopMost = true;
|
||||||
|
this.Activate();
|
||||||
|
this.TopMost = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -427,6 +437,9 @@ namespace DisplayMagician.UIForms
|
|||||||
Restore();
|
Restore();
|
||||||
Show();
|
Show();
|
||||||
BringToFront();
|
BringToFront();
|
||||||
|
this.TopMost = true;
|
||||||
|
this.Activate();
|
||||||
|
this.TopMost = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void exitApplication()
|
public void exitApplication()
|
||||||
|
Loading…
Reference in New Issue
Block a user