Put Below code inside Form Closing Event
Please use the Environment.Exit(0); in Form Closing Event.
/// <summary>
/// Form Close Event
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void DCDFormat_FormClosing(object sender, FormClosingEventArgs e)
{
///For exit from application
Environment.Exit(0);
}
Please use the Environment.Exit(0); in Form Closing Event.
/// <summary>
/// Form Close Event
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void DCDFormat_FormClosing(object sender, FormClosingEventArgs e)
{
///For exit from application
Environment.Exit(0);
}