Detecta el reinicio de windows y se cierra sin pedir confirmacion
This commit is contained in:
parent
828315fd94
commit
45d5aca358
|
@ -134,8 +134,18 @@ namespace LectorVerdnatura
|
|||
|
||||
private void Salir_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.notifyIcon1.Visible = false;
|
||||
this.Dispose();
|
||||
if (!systemShutdown)
|
||||
{
|
||||
// Reset the variable because the user might cancel the shutdown.
|
||||
systemShutdown = false;
|
||||
|
||||
DialogResult respuesta = MessageBox.Show("La aplicacion debe estar en marcha para recoger los fichajes!" + Environment.NewLine + "¿ Esta seguro de que desea cerrar la aplicacion ?", "Confirmacion", MessageBoxButtons.YesNo);
|
||||
if (respuesta == DialogResult.Yes)
|
||||
{
|
||||
this.notifyIcon1.Visible = false;
|
||||
Application.Exit();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void timer1_Tick(object sender, EventArgs e)
|
||||
|
|
Reference in New Issue