I have a problem with this event code click on the cancel button of a login form.
private void btnCancelar_Click(object sender, EventArgs e)
{
if (MessageBox.Show(@"Esta seguro que desea salir del sistema?", @"Atención",
MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
{
Application.Exit();
}
else
{
txtUsuario.Focus();
}
}
Pressing the cancel button opens a warning message of whether or not I am sure of leaving the system, by pressing "no" it would be closing the same, I would appreciate your help.