cours01/COURS01/FPrincipal.cs

56 lines
1.4 KiB
C#
Raw Normal View History

2018-02-07 13:19:33 +01:00
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace COURS01
{
public partial class EcranPrincipal : Form
{
2018-02-07 14:29:14 +01:00
Form parentToClose;
bool parentToCloseF;
2018-02-07 13:19:33 +01:00
public EcranPrincipal()
{
2018-02-07 14:29:14 +01:00
parentToCloseF = false;
2018-02-07 13:19:33 +01:00
InitializeComponent();
}
2018-02-07 14:29:14 +01:00
public EcranPrincipal(Form parentToClose)
{
parentToCloseF = true;
InitializeComponent();
this.parentToClose = parentToClose;
}
2018-02-07 13:19:33 +01:00
private void mQuitter_Click(object sender, EventArgs e)
{
2018-02-07 14:37:48 +01:00
Close();
2018-02-07 13:19:33 +01:00
}
2018-02-07 14:29:14 +01:00
private void mQuitter_Click(object sender, FormClosingEventArgs e)
{
2018-02-07 14:37:48 +01:00
Close();
2018-02-07 14:29:14 +01:00
}
2018-02-07 13:19:33 +01:00
private void mNDef_Click(object sender, EventArgs e)
{
MessageBox.Show("Fonctionnalité non implémentée");
}
2018-02-07 14:37:48 +01:00
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;
}
}
2018-02-07 13:19:33 +01:00
}
}