Esempio n. 1
0
 private void button6_Click(object sender, EventArgs e)
 {
     if (button6.Text == "Modifier")
     {
         #region getion intrface bouton Modifier
         textBox1.ReadOnly = true;
         textBox2.ReadOnly = false;
         textBox3.ReadOnly = false;
         textBox4.ReadOnly = false;
         textBox5.ReadOnly = false;
         button1.Enabled   = false;
         button2.Enabled   = false;
         button3.Enabled   = false;
         button4.Enabled   = false;
         button5.Enabled   = false;
         button7.Enabled   = false;
         button8.Enabled   = false;
         button9.Enabled   = true;
         #endregion
         button6.Text = "Valider";
     }
     else
     {
         Chs.Modifier(CréerChasseur());
         EtatInitiale();
     }
 }
Esempio n. 2
0
 private void button6_Click(object sender, EventArgs e)
 {
     if (Chs.PositionChasseursEncours != -1)
     {
         if (button6.Text == "Modifier")
         {
             textenablT();
             button5.Enabled = false;
             button7.Enabled = false;
             buttonEnablF();
             buttonposF();
             button6.Enabled = true;
             button6.Text    = "Valider";
         }
         else if (textBox1.Text != "" && textBox2.Text != "" && textBox3.Text != "" && button6.Text == "Valider")
         {
             if (Chs.NombreChasseursParticipant <= 1)
             {
                 buttonposF();
             }
             else if (Chs.NombreChasseursParticipant == 2)
             {
                 buttonposF();
                 button2.Enabled = true;
                 button3.Enabled = true;
             }
             else
             {
                 buttonposT(); button8.Enabled = true;
             }
             button5.Enabled = true;
             button7.Enabled = true;
             Chs.Modifier(CreerCh());
             textenablF();
             button6.Text = "Modifier";
         }
         else
         {
             MessageBox.Show("Remplire les zones de text vide .", "Modification", MessageBoxButtons.OK);
         }
     }
     position();
 }