private void btnClose_Click(object sender, EventArgs e)
{
if( btnClose.Text != "Cancel")
{
DialogResult result = MessageBox.Show("Are you sure you want to exit application?", "SharePoint Data Generation", MessageBoxButtons.YesNo);
if (result == System.Windows.Forms.DialogResult.Yes)
{
Application.Exit();
}
}
}