Hi i m new in c#.
i want to my button enable when i select any item in list box.
i m able to do it but when i deselect all the items in listbox so my button is still enable.i want to disable now when no item is selected in list box..
Regards...
Farhad Idrees
Farhad.idrees
1
Junior Poster in Training
Recommended Answers
Jump to Postprivate void listBox1_SelectedIndexChanged(object sender, EventArgs e) { if (listBox1.SelectedIndices.Count > 0) { button1.Enabled = true; } else { button1.Enabled = false; } }
All 2 Replies
Reply to this topic
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.