Exemplo n.º 1
0
        private void ExitToolStripMenuItem_Click(object sender, EventArgs e)
        {
            this.ExitToolStripMenuItem.Enabled = false;
            this.SafetyExit.Enabled            = false;
            ExitForm exitForm = new ExitForm();

            exitForm.ShowDialog();
        }
Exemplo n.º 2
0
        private void Form1_FormClosing(object sender, FormClosingEventArgs e)
        {
            DialogResult dlgResult = MessageBox.Show(Resource.lHelper.Key("m2"), Resource.lHelper.Key("m1"), MessageBoxButtons.YesNo, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2);

            if (dlgResult != DialogResult.Yes)
            {
                this.WindowState    = FormWindowState.Normal;
                notifyIcon1.Visible = true;
                this.Hide();

                this.ShowInTaskbar = false;
                e.Cancel           = true;
            }
            else
            {
                ExitForm exitForm = new ExitForm();
                exitForm.ShowDialog();
            }
        }