private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
if (MessageBox.Show("即將關閉,是否繼續?", "確認", MessageBoxButtons.YesNo) == DialogResult.Yes)
{
e.Cancel = false; //關閉視窗
}
else
{
e.Cancel = true; //取消關閉
}
}
private void button1_Click(object sender, EventArgs e)
{
this.Close(); //關閉視窗button
}
沒有留言:
張貼留言