C # Winform study notes

namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

void Form1_FormClosing Private (Object SENDER, FormClosingEventArgs E)
{
DialogResult the Result = MessageBox.Show ( "confirm that you want to quit?", "message alert", MessageBoxButtons.OKCancel, MessageBoxIcon.Exclamation);

if (result==DialogResult.Cancel)
{
e.Cancel = true;
}
}

private void tsbExit_Click(object sender, EventArgs e)
{
this.Close();
}

private void button1_Click(object sender, EventArgs e)
{
this.Close();
}

private void Form1_FormClosed(object sender, FormClosedEventArgs e)
{
MessageBox.Show("China");
}
}
}

// the current form of exit this.close () will be executed formClosing events, and events formClosed

Guess you like

Origin www.cnblogs.com/MyVision/p/10991459.html