Beispiel #1
0
 private void InitPlayer()
 {
     //FOR OLD PLAYER
     foreach (var data in list)
     {
         var player = new UCPlayer(data);
         flowLayoutPanel1.Controls.Add(player);
     }
 }
Beispiel #2
0
        private void button2_Click(object sender, EventArgs e)
        {
            if (flowLayoutPanel1.Controls.Count >= 10)
            {
                btnAddPlayer.Visible = false;
                return;
            }

            var player = new UCPlayer();

            flowLayoutPanel1.Controls.Add(player);
            flowLayoutPanel1.Controls.SetChildIndex(player, flowLayoutPanel1.Controls.Count);
        }
Beispiel #3
0
        private bool isValid(UCPlayer player, int counter)
        {
            int counterCheck = 0;

            foreach (var c in flowLayoutPanel1.Controls.OfType <UCPlayer>())
            {
                if (counterCheck == counter)
                {
                    continue;
                }
                if (string.Equals(c.cmbNo.SelectedItem.ToString(), player.cmbNo.SelectedItem.ToString(), StringComparison.OrdinalIgnoreCase))
                {
                    return(false);
                }
                counterCheck++;
            }

            return(true);
        }