예제 #1
0
파일: View.cs 프로젝트: huarthu/CSGOL
        /// <summary>
        /// Dessine dans le panel les éléments boutons d'une grille de cellules
        /// </summary>
        /// <param name="cellGrid"></param>
        private void DrawCells(CellGrid cellGrid)
        {
            //Clear efficace des précédents contrôles
            List <Control> ctrls = new List <Control>(pnlCells.Controls.Count);

            pnlCells.Controls.Clear();
            foreach (Control c in ctrls)
            {
                c.Dispose();
            }

            for (int j = 0; j < cellGrid.cells.Count; j++)
            {
                pnlCells.Controls.Add(cellGrid.cells[j].btnElement);
            }
        }