private void AddDeckToFlowLayout(string title, string author, int numCards, int idBD, bool privacy) { DeckButton deckButton = new DeckButton(idTheme, ref deckSelected); deckButton.Title = title; deckButton.Author = author; deckButton.Cards = numCards; deckButton.Privacy = privacy; deckButton.Color = colorButtons; deckButton.Id = idBD; deckButton.CurrentUser = labelUser.Text; flowLayoutPanelDecks.Controls.Add(deckButton); }
private void btnConsult_Click(object sender, EventArgs e) { foreach (Control c in flowLayoutPanelDecks.Controls) { c.Visible = true; } for (int i = 0; i < flowLayoutPanelDecks.Controls.Count; i++) { DeckButton temp = (DeckButton)Convert.ChangeType(flowLayoutPanelDecks.Controls[i], typeof(DeckButton)); if (!temp.Title.Contains(txtSearch.Text)) { flowLayoutPanelDecks.Controls[i].Visible = false; } } }