private void btnBack_Click(object sender, EventArgs e) { StartScreen ss = new StartScreen(sc.name, sc.date); ss.Show(); this.Hide(); }
public NamesScreen(StartScreen sc) { this.sc = sc; InitializeComponent(); lblTournamentName.Text = sc.name; namesList = new List <string>(); this.BackColor = Design.COLORLIGHTER; this.Font = Design.FONTNORMAL; lblEnterNames.Font = Design.FONTBIGBOLD; lblTournamentName.Font = Design.FONTTITLE; btnAdd.BackColor = Design.COLORLIGHTEST; btnAdd.FlatStyle = FlatStyle.Flat; btnBack.BackColor = Design.COLORLIGHTEST; btnBack.FlatStyle = FlatStyle.Flat; btnNext.BackColor = Design.COLORLIGHTEST; btnNext.FlatStyle = FlatStyle.Flat; btnRemove.BackColor = Design.COLORLIGHTEST; btnRemove.FlatStyle = FlatStyle.Flat; namesList.Add("Charlene"); namesList.Add("Jasper"); namesList.Add("Henkie"); namesList.Add("Petertje"); lsbNames.DataSource = namesList; if (lsbNames.Items.Count == 0) { ButtonEnabled(btnRemove, false); } else { lsbNames.SelectedIndex = namesList.IndexOf(namesList.First(), 0); } }
public RosterScreen(List <string> members, StartScreen sc) { InitializeComponent(); lsbNames.MouseDown += lsbNames_MouseDown; this.members = members; startScreen = sc; this.BackColor = Design.COLORLIGHTER; this.Font = Design.FONTSMALL; btnPrint.BackColor = Design.COLORLIGHTEST; btnPrint.FlatStyle = FlatStyle.Flat; btnSaveAsPDF.BackColor = Design.COLORLIGHTEST; btnSaveAsPDF.FlatStyle = FlatStyle.Flat; this.FieldPanel = new Panel(); this.Controls.Add(FieldPanel); FieldPanel.AutoScroll = true; FieldPanel.Location = new Point(230, 60); FieldPanel.Height = this.Height - 100; FieldPanel.Width = 700; int x = 0; int y = 0; #region Generate forms for the amount of fields for (int i = 1; i <= startScreen.amountOfFields; i++) { Label lblCourt = new Label(); TextBox txtCourt = new TextBox(); this.lsbTeamA = new ListBox(); this.lsbTeamB = new ListBox(); // // lblCourt // lblCourt.AutoSize = true; lblCourt.Location = new System.Drawing.Point(x, y); lblCourt.Name = "lblCourt" + i; lblCourt.Size = new System.Drawing.Size(31, 13); lblCourt.TabIndex = 1; lblCourt.Text = "Veld:"; // // txtCourt // txtCourt.Location = new System.Drawing.Point(x + 53, y); txtCourt.Name = "txtCourt" + i; txtCourt.Size = new System.Drawing.Size(100, 20); txtCourt.TabIndex = 2; txtCourt.Text = i + ""; txtCourt.ReadOnly = true; // // lsbTeamA // lsbTeamA.FormattingEnabled = true; lsbTeamA.Location = new System.Drawing.Point(x, y + 29); lsbTeamA.Name = "lsbTeamA" + i; lsbTeamA.Size = new System.Drawing.Size(153, 43); lsbTeamA.TabIndex = 3; // // lsbTeamB // lsbTeamB.FormattingEnabled = true; lsbTeamB.Location = new System.Drawing.Point(x, y + 79); lsbTeamB.Name = "lsbTeamB" + i; lsbTeamB.Size = new System.Drawing.Size(153, 43); lsbTeamB.TabIndex = 4; FieldPanel.Controls.Add(lblCourt); FieldPanel.Controls.Add(txtCourt); FieldPanel.Controls.Add(lsbTeamA); FieldPanel.Controls.Add(lsbTeamB); x += 175; if (x >= 650) { x = 0; y += 150; } lsbTeamA.AllowDrop = true; lsbTeamB.AllowDrop = true; lsbTeamA.DragDrop += lsbTeam_DragDrop; lsbTeamA.DragOver += lsbTeam_DragOver; lsbTeamB.DragDrop += lsbTeam_DragDrop; lsbTeamB.DragOver += lsbTeam_DragOver; } this.Controls.Add(this.lsbNames); lsbNames.DataSource = members; lsbNames.AllowDrop = true; #endregion }