Example #1
0
        // Корректное завершение работы
        protected override void OnClosing(CancelEventArgs e)
        {
            base.OnClosing(e);

            if (!goToList)
            {
                DialogResult result = MessageBox.Show("Хотите вернуться на форму авторизации?",
                                                      "Сообщение",
                                                      MessageBoxButtons.YesNoCancel,
                                                      MessageBoxIcon.Information,
                                                      MessageBoxDefaultButton.Button1,
                                                      MessageBoxOptions.DefaultDesktopOnly);

                if (result == DialogResult.Yes)
                {
                    startForm.Show();
                }
                else if (result == DialogResult.No)
                {
                    startForm.Close();
                }
                else
                {
                    MainForm newForm = new MainForm(username, startForm);
                    newForm.Show();
                }
                TempFunction();
            }
        }
Example #2
0
        // Корректное завершение работы
        protected override void OnClosed(EventArgs e)
        {
            base.OnClosed(e);
            if (!goToMain)
            {
                DialogResult result = MessageBox.Show("Хотите вернуться на форму авторизации?",
                                                      "Сообщение",
                                                      MessageBoxButtons.YesNoCancel,
                                                      MessageBoxIcon.Information,
                                                      MessageBoxDefaultButton.Button1,
                                                      MessageBoxOptions.DefaultDesktopOnly);

                if (result == DialogResult.Yes)
                {
                    startForm.Show();
                    startForm.Activate();
                }
                else if (result == DialogResult.No)
                {
                    startForm.Close();
                }
                else
                {
                    TableOfList newForm = new TableOfList(username, startForm, ID, creator, name);
                    newForm.Show();
                    newForm.Activate();
                    this.Close();
                }
            }
        }
Example #3
0
 // Возвращение на первую форму
 private void BackButton_Click(object sender, EventArgs e)
 {
     ToStart = true;
     startForm.Show();
     this.Close();
 }