Accueil quit V2 Proff OK

This commit is contained in:
adri 2018-02-07 14:37:48 +01:00
parent 115f20211b
commit da7582e3c8
11 changed files with 18 additions and 37 deletions

View File

@ -90,7 +90,6 @@
this.MinimizeBox = false; this.MinimizeBox = false;
this.Name = "EcranAccueil"; this.Name = "EcranAccueil";
this.Text = "Bienvenue, welcome,..."; this.Text = "Bienvenue, welcome,...";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.EcranAccueil_FormClosing);
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
this.ResumeLayout(false); this.ResumeLayout(false);
this.PerformLayout(); this.PerformLayout();

View File

@ -35,23 +35,9 @@ namespace COURS01
} }
} }
private void EcranAccueil_FormClosing(object sender, FormClosingEventArgs e)
{
if (MessageBox.Show("Voulez-vous vraiment quiter ?", "Souhait", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
{
e.Cancel = false;
}
else
{
e.Cancel = true;
}
}
private void btnEntrez_Click(object sender, EventArgs e) private void btnEntrez_Click(object sender, EventArgs e)
{ {
EcranPrincipal f = new EcranPrincipal(this); Close();
this.Hide();
f.ShowDialog();//Bloque la fenetre parrent alors que show ne bloque pas le parent
} }
} }
} }

View File

@ -109,7 +109,7 @@
this.MinimizeBox = false; this.MinimizeBox = false;
this.Name = "EcranPrincipal"; this.Name = "EcranPrincipal";
this.Text = "Ecran Principal"; this.Text = "Ecran Principal";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.mQuitter_Click); this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.EcranAccueil_FormClosing);
this.menuStrip1.ResumeLayout(false); this.menuStrip1.ResumeLayout(false);
this.menuStrip1.PerformLayout(); this.menuStrip1.PerformLayout();
this.ResumeLayout(false); this.ResumeLayout(false);

View File

@ -27,35 +27,29 @@ namespace COURS01
} }
private void mQuitter_Click(object sender, EventArgs e) private void mQuitter_Click(object sender, EventArgs e)
{ {
if(parentToCloseF)
{
parentToClose.Close();
if (parentToClose.IsDisposed)
Close();
}
else
Close(); Close();
} }
private void mQuitter_Click(object sender, FormClosingEventArgs e) private void mQuitter_Click(object sender, FormClosingEventArgs e)
{ {
if (parentToCloseF) Close();
{
parentToClose.Close();
if (parentToClose.IsDisposed)
{
e.Cancel = false;
}
else
e.Cancel = true;
}
else
e.Cancel = false;
} }
private void mNDef_Click(object sender, EventArgs e) private void mNDef_Click(object sender, EventArgs e)
{ {
MessageBox.Show("Fonctionnalité non implémentée"); MessageBox.Show("Fonctionnalité non implémentée");
} }
private void EcranAccueil_FormClosing(object sender, FormClosingEventArgs e)
{
if (MessageBox.Show("Voulez-vous vraiment quiter ?", "Souhait", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
{
e.Cancel = false;
}
else
{
e.Cancel = true;
}
}
} }
} }

View File

@ -17,6 +17,7 @@ namespace COURS01
Application.EnableVisualStyles(); Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false); Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new EcranAccueil()); Application.Run(new EcranAccueil());
Application.Run(new EcranPrincipal());
} }
} }
} }

Binary file not shown.

Binary file not shown.

View File

@ -8,3 +8,4 @@ C:\Users\Adrien\source\repos\COURS01\COURS01\obj\Debug\COURS01.csproj.CoreCompil
C:\Users\Adrien\source\repos\COURS01\COURS01\obj\Debug\COURS01.exe C:\Users\Adrien\source\repos\COURS01\COURS01\obj\Debug\COURS01.exe
C:\Users\Adrien\source\repos\COURS01\COURS01\obj\Debug\COURS01.pdb C:\Users\Adrien\source\repos\COURS01\COURS01\obj\Debug\COURS01.pdb
C:\Users\Adrien\source\repos\COURS01\COURS01\obj\Debug\COURS01.EcranPrincipal.resources C:\Users\Adrien\source\repos\COURS01\COURS01\obj\Debug\COURS01.EcranPrincipal.resources
C:\Users\Adrien\source\repos\COURS01\COURS01\obj\Debug\COURS01.csprojResolveAssemblyReference.cache

Binary file not shown.

Binary file not shown.