using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;namespace CloseWindow
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
} private void button1_Click(object sender, EventArgs e)
{
if (MessageBox.Show("您确定要关闭", "关闭", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes)
{
this.Validate()
this.Close();
}
}
}
}
-----------
测试通过看来是以下两句的问题,查查看
this.下载文章记录BindingSource.EndEdit();
this.下载文章记录TableAdapter.Update(this.日常事务日志DataSet.下载文章记录);
Good Luck!
Tony!
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;namespace CloseWindow
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
} private void button1_Click(object sender, EventArgs e)
{
if (MessageBox.Show("您确定要关闭", "关闭", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes)
{
this.Validate()
this.Close();
}
}
}
}
-----------
测试通过看来是以下两句的问题,查查看
this.下载文章记录BindingSource.EndEdit();
this.下载文章记录TableAdapter.Update(this.日常事务日志DataSet.下载文章记录);
Good Luck!
Tony!
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
if (MessageBox.Show("是否要保存数据?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1 ) != DialogResult.No )
{
this.Validate();
this.下载文章记录BindingSource.EndEdit();
this.下载文章记录TableAdapter.Update(this.日常事务日志DataSet.下载文章记录);
}
}谢谢!