예제 #1
0
        private void AddTableRowGeneticData()
        {
            var             table     = this.tableLayoutPanel;
            int             colAmount = table.ColumnCount;
            int             rowIndex  = table.RowStyles.Count;
            GeneticTableRow tableRow;

            tableRow      = new GeneticTableRow();
            tableRow.Dock = DockStyle.Fill;

            if (rowIndex % 2 == 0)
            {
                tableRow.BackColor = ColorConstants.tableBackgroundColor;
                tableRow.BackColor = ColorConstants.tableBackgroundColor;
                tableRow.setTextBoxBackgroundColor(ColorConstants.tableBackgroundColor);
            }
            else
            {
                tableRow.BackColor = Color.White;
                tableRow.BackColor = Color.White;
                tableRow.setTextBoxBackgroundColor(Color.White);
            }

            tableRow.BorderStyle = BorderStyle.None;
            table.SetColumnSpan(tableRow, colAmount);
            table.Controls.Add(tableRow, 0, rowIndex);
            table.RowStyles.Add(new RowStyle(SizeType.Absolute, 25));
        }
예제 #2
0
        public void CreateGeneticTable(List <string> modelParams, float rowSize, float colSize, int colAmount, int amountOfRows)
        {
            int rowIndex = 0;
            var table    = this.tableLayoutPanel;

            table.Controls.Clear();
            table.RowStyles.Clear();
            table.ColumnCount = colAmount;
            table.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, colSize));
            var tableRowHeader = new GeneticTableHeader();

            tableRowHeader.InitHeaderNames(modelParams);
            tableRowHeader.Dock      = DockStyle.Fill;
            tableRowHeader.BackColor = ColorConstants.tableHeaderColor;

            table.SetColumnSpan(tableRowHeader, table.ColumnCount);
            table.Controls.Add(tableRowHeader, 0, rowIndex);

            table.RowStyles.Add(new RowStyle(SizeType.Absolute, rowSize));
            rowIndex++;
            while (rowIndex < amountOfRows)
            {
                var tableRow = new GeneticTableRow();
                tableRow.Dock = DockStyle.Fill;



                if (rowIndex % 2 == 0)
                {
                    tableRow.BackColor = ColorConstants.tableBackgroundColor;
                    tableRow.BackColor = ColorConstants.tableBackgroundColor;
                    tableRow.setTextBoxBackgroundColor(ColorConstants.tableBackgroundColor);
                }
                else
                {
                    tableRow.BackColor = Color.White;
                    tableRow.BackColor = Color.White;
                    tableRow.setTextBoxBackgroundColor(Color.White);
                }
                tableRow.BorderStyle = BorderStyle.None;
                table.SetColumnSpan(tableRow, colAmount);
                table.Controls.Add(tableRow, 0, rowIndex);
                table.RowStyles.Add(new RowStyle(SizeType.Absolute, rowSize));



                rowIndex++;
            }
        }