Reputation: 153
I have added many items in my listbox and I am using selected items of listbox using this code:
listBox1.SelectedIndex = listBox1.SelectedIndex + 1;
I also want to disable click in listbox. Please tell me how can I disable click in listbox when program is running.
Upvotes: 1
Views: 3324
Reputation: 151604
Simply set the Enabled
property to false to disable user interaction.
However, this sounds as if you're (ab)using the GUI to implement application logic. Shouldn't you use a List<something>
to store and iterate through your items and update your ListBox from the List<> instead of depending on what's on screen?
Upvotes: 2