Пример #1
0
        public frmLogin()
        {
            InitializeComponent();

            //Added to support default instance behavour in C#
            if (defaultInstance == null)
                defaultInstance = this;

            mConn = new MySqlConnection(connStr);
        }
Пример #2
0
 private void frmStudent_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (exflag)
     {
         e.Cancel = false;
     }
     else if (MessageBox.Show("This will log you out, do you want to continue?", "Log out", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes)
     {
         e.Cancel = true;
         frmLogin lg = new frmLogin();
         lg.Show();
         exflag = true;
         this.Close();
     }
     else
     {
         e.Cancel = true;
     }
 }
Пример #3
0
 static void defaultInstance_FormClosed(object sender, FormClosedEventArgs e)
 {
     defaultInstance = null;
 }