I have listbox with Buttons. Every button have specific name -> button.Name = "button1".
I want to find specific button in listbox by Name.
I tried something like this:
if (listBox.Items.Contains(new Button().Name = "button2"))
{
MessageBox.Show("TEST");
}
But it doesnt work.
How to find it?