private void initializeTaskField() { taskTableLayoutPanel = new OpacityTableLayoutPanel() { Dock = DockStyle.Fill }; spaceTableLayoutPanel.Controls.Add(taskTableLayoutPanel, 1, 1); spaceTableLayoutPanel.SetColumnSpan(taskTableLayoutPanel, calculateFieldSide() - 2); spaceTableLayoutPanel.SetRowSpan(taskTableLayoutPanel, calculateFieldSide() - 2); //spaceTableLayoutPanel.CellBorderStyle = TableLayoutPanelCellBorderStyle.InsetDouble; taskTableLayoutPanel.ColumnCount = 3; taskTableLayoutPanel.BackgroundImage = global::MIC_Monopolia.Properties.Resources.wall; taskTableLayoutPanel.BackgroundImageLayout = ImageLayout.Zoom; taskTableLayoutPanel.BackColor = Color.White; taskTableLayoutPanel.ColumnStyles.Insert(0, new ColumnStyle(SizeType.AutoSize)); taskTableLayoutPanel.ColumnStyles.Insert(1, new ColumnStyle(SizeType.Percent, 70)); taskTableLayoutPanel.ColumnStyles.Insert(2, new ColumnStyle(SizeType.AutoSize)); int chipSidePercent = PERCENT_100 / statisticTableLayoutPanel.RowCount; taskTableLayoutPanel.RowCount = chips.Length; for (int i = 0; i < taskTableLayoutPanel.RowCount; i++) { taskTableLayoutPanel.RowStyles.Insert(i, new RowStyle(SizeType.Percent, chipSidePercent)); } for (int i = 0; i < tasksLabels.Length; i++) { tasksLabels[i] = new OpacityLabel() { Text = "Задание", Dock = DockStyle.Fill }; tasksPerformButtons[i] = new PerformButton() { Text = "+", Dock = DockStyle.Fill, PlayerIndex = i }; tasksPerformButtons[i].Click += new EventHandler(tasksPerformButton_Click); positionLabels[i] = new OpacityLabel() { Text = "0", Dock = DockStyle.Fill , Visible = false }; } for (int i = 0; i < tasksLabels.Length; i++) { taskTableLayoutPanel.Controls.Add(tasksStaticCloneChips[i], 0, i); taskTableLayoutPanel.Controls.Add(tasksLabels[i], 1, i); taskTableLayoutPanel.Controls.Add(positionLabels[i], 2, i); taskTableLayoutPanel.Controls.Add(tasksPerformButtons[i], 3, i); } }
private void initializePointPlayersLabel() { for (int i = 0; i < moneyPlayersLabel.Length; i++) { moneyPlayersLabel[i] = new OpacityLabel() { Dock = DockStyle.Fill, TextAlign = ContentAlignment.MiddleCenter, Font = new Font("PF Beausans Pro Light", 7F, FontStyle.Bold), Text = "0" }; peoplePlayersLabel[i] = new OpacityLabel() { Dock = DockStyle.Fill, TextAlign = ContentAlignment.MiddleCenter, Font = new Font("PF Beausans Pro Light", 7F, FontStyle.Bold), Text = "0" }; famousPlayersLabel[i] = new OpacityLabel() { Dock = DockStyle.Fill, TextAlign = ContentAlignment.MiddleCenter, Font = new Font("PF Beausans Pro Light", 7F, FontStyle.Bold), Text = "0" }; } for (int i = 0; i < moneyPlayersLabel.Length; i++) { statisticTableLayoutPanel.Controls.Add(moneyPlayersLabel[i], MONEY_COLUMN_INDEX, i); statisticTableLayoutPanel.Controls.Add(peoplePlayersLabel[i], PEOPLE_COLUMN_INDEX, i); statisticTableLayoutPanel.Controls.Add(famousPlayersLabel[i], FAMOUS_COLUMN_INDEX, i); } }