private void textBoxFirstName_TextChanged(object sender, EventArgs e) { buttonBook.Visible = false; labelTickets.Visible = false; bool valid = festivalHandler.FirstNameValid(textBoxFirstName.Text); if (valid == true) { pictureBoxFirstName.Image = Image.FromFile("CheckmarkIcon.png"); pictureBoxFirstName.Visible = true; if (festivalHandler.LastNameValid(textBoxLastName.Text) == true) { if (festivalHandler.PhoneNumberValid(textBoxPhoneNumber.Text) == true) { labelTickets.Visible = true; comboBoxTickets.Visible = true; buttonBook.Visible = true; //List<int> tickets = new List<int>(); //var amountOfTicketsInTheater = theater.SeatsLeft; //int counter = 1; //for (int i = 0; i < amountOfTicketsInTheater; i++) //{ // tickets[i] = counter; // counter++; //} //foreach (var item in tickets) //{ // comboBoxTickets.SelectedItem = item.ToString(); //} } } } else if (valid == false) { pictureBoxFirstName.Image = Image.FromFile("CrossmarkIcon.png"); pictureBoxFirstName.Visible = true; comboBoxTickets.Visible = false; } if (textBoxFirstName.Text == "") { pictureBoxFirstName.Visible = false; comboBoxTickets.Visible = false; } }