Esempio n. 1
0
 /// <summary>
 /// Событие для вызова формы пароля
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void tabControl1_SelectedIndexChanged(object sender, EventArgs e)
 {
     if ((sender as TabControl).SelectedIndex == 1) // База данных
     {
         if (database != null && !isCorrectPass)
         {
             PassForm passForm = new PassForm();
             passForm.ShowDialog();
             EnableBaseTabControls(isCorrectPass);
         }
     }
 }
Esempio n. 2
0
        /// <summary>
        /// Управление активностью элементов
        /// </summary>
        /// <param name="enable"></param>
        private void EnabledControls(bool enable)
        {
            saveToolStripButton.Enabled     = enable;
            saveAsToolStripMenuItem.Enabled = enable;
            saveAsToolStripMenuItem.Enabled = enable;
            insertToolStripButton.Enabled   = enable;
            copyToolStripButton.Enabled     = enable;
            cutToolStripButton.Enabled      = enable;
            printToolStripButton.Enabled    = enable;
            aboutToolStripButton.Enabled    = enable;
            btnStartGame.Visible            = enable;

            if (tabControl1.SelectedIndex == 1 && !isCorrectPass)
            {
                PassForm passForm = new PassForm();
                passForm.ShowDialog();
            }
            EnableBaseTabControls(isCorrectPass);
        }