How to prevent ListBox.SelectedIndexChanged event?

后端 未结 7 1460
时光说笑
时光说笑 2020-12-16 11:37

I am using a listbox in my C#2.0 windows forms application. The method to populate the list box is

    private void PopulateListBox(ListBox lb, ReportColum         


        
7条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-16 11:56

    Inside the SelectedIndexChanged method, just pit in an if statement that says, if SelectedIndex == -1 do nothing else, do whatever you want to do in this method, probably not the most efficient code but worked for me :)

提交回复
热议问题