http://msdn.microsoft.com/en-us/library/system.windows.forms.form.formclosing(v=vs.80).aspx

 

 

 private void ConfigurationTool_FormClosing(object sender, FormClosingEventArgs e)
        {
            if (IsChanged())
            {
                DialogResult result = MessageBox.Show(Resources.ResourceManager.GetString("ConfirmeMessage"), Resources.ResourceManager.GetString("ProduceTitle"), MessageBoxButtons.YesNo, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1);
                if (result != DialogResult.Yes)
                {
                    e.Cancel = true;                   
                }               
            }                     
        }

 

posted on 2012-07-11 10:59  higirle  阅读(290)  评论(0编辑  收藏  举报