Ejemplo n.º 1
0
        private void bRemove_Click(object sender, EventArgs e)
        {
            int i = 0;

            try
            {
                i = ListPlayer.Items.Count;
                ListPlayer.Items.RemoveAt(--i);
                lNumber.Text = Convert.ToString(ListPlayer.Items.Count);
            }
            catch (Exception)
            {
                mbox("Non ci sono più giocatori nella lista.");
            }
            UNPlayer.Clear();
            UNPlayer.Focus();
        }
Ejemplo n.º 2
0
 private void bInsert_Click(object sender, EventArgs e)
 {
     if (UNPlayer.Text != "")
     {
         if (ListPlayer.Items.Count != 8)
         {
             ListPlayer.Items.Add(UNPlayer.Text);
             lNumber.Text = Convert.ToString(ListPlayer.Items.Count);
         }
         else
         {
             mbox("Nummero massimo di giocatori raggiunto.");
         }
     }
     else
     {
         mbox("Inserisci il nome del giocatore prima.");
     }
     UNPlayer.Clear();
     UNPlayer.Focus();
 }