Fixed form StartPositions

This commit is contained in:
pointfeev 2021-07-30 03:19:46 -05:00
parent 0a4cf5851f
commit 3189e7462a
8 changed files with 14 additions and 11 deletions

View file

@ -6,7 +6,7 @@
<UseWindowsForms>true</UseWindowsForms>
<ApplicationIcon>ini.ico</ApplicationIcon>
<IncludeAllContentForSelfExtract>true</IncludeAllContentForSelfExtract>
<Version>1.0.1</Version>
<Version>1.0.2</Version>
<PackageIcon>ini.ico</PackageIcon>
<PackageIconUrl />
<Description>Automatically downloads and installs CreamAPI files for programs/games.</Description>

View file

@ -131,7 +131,7 @@ namespace CreamInstaller
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "DialogForm";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "DialogForm";
this.TopMost = true;
((System.ComponentModel.ISupportInitialize)(this.icon)).EndInit();

View file

@ -6,8 +6,9 @@ namespace CreamInstaller
{
public partial class DialogForm : Form
{
public DialogForm()
public DialogForm(IWin32Window owner)
{
Owner = owner as Form;
InitializeComponent();
}

View file

@ -126,7 +126,7 @@ namespace CreamInstaller
this.MinimumSize = new System.Drawing.Size(500, 300);
this.Name = "InstallForm";
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Show;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "InstallForm";
this.TopMost = true;
this.Load += new System.EventHandler(this.OnLoad);

View file

@ -11,8 +11,9 @@ namespace CreamInstaller
{
public partial class InstallForm : Form
{
public InstallForm()
public InstallForm(IWin32Window owner)
{
Owner = owner as Form;
InitializeComponent();
Program.InstallForm = this;
Text = Program.ApplicationName;

View file

@ -32,7 +32,7 @@ namespace CreamInstaller
}
Hide();
new SelectForm().ShowDialog();
new SelectForm(this).ShowDialog();
Close();
}
@ -86,7 +86,7 @@ namespace CreamInstaller
string FileName = Path.GetFileName(Program.CurrentProcessFilePath);
if (FileName != "CreamInstaller.exe")
{
if (new DialogForm().Show(Program.ApplicationName, SystemIcons.Warning,
if (new DialogForm(this).Show(Program.ApplicationName, SystemIcons.Warning,
"WARNING: CreamInstaller.exe was renamed!" +
"\n\nThis will cause unwanted behavior when updating the program!",
"Ignore", "Abort") == DialogResult.Cancel)
@ -104,7 +104,7 @@ namespace CreamInstaller
}
catch (ApiException)
{
if (new DialogForm().Show(Program.ApplicationName, SystemIcons.Warning,
if (new DialogForm(this).Show(Program.ApplicationName, SystemIcons.Warning,
$"ERROR: Failed logging into MEGA!" +
"\n\nMEGA is likely offline, please try again later. . .",
"Retry", "Cancel") == DialogResult.OK)

View file

@ -149,7 +149,7 @@ namespace CreamInstaller
this.MinimumSize = new System.Drawing.Size(500, 328);
this.Name = "SelectForm";
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Show;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "SelectForm";
this.TopMost = true;
this.Load += new System.EventHandler(this.OnLoad);

View file

@ -13,8 +13,9 @@ namespace CreamInstaller
{
public partial class SelectForm : Form
{
public SelectForm()
public SelectForm(IWin32Window owner)
{
Owner = owner as Form;
InitializeComponent();
Program.SelectForm = this;
Text = Program.ApplicationName;
@ -222,7 +223,7 @@ namespace CreamInstaller
if (Program.ProgramSelections.Count > 0)
{
Hide();
new InstallForm().ShowDialog();
new InstallForm(this).ShowDialog();
Close();
}
}