Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Winforms ComboBox SelectedValueChange event

How do I prevent code from executing in the SelectedValueChange event of a combobox when the combobox is being loaded for the first time? I need the code to execute when the user has selected a new value.

like image 560
scantwell71 Avatar asked Dec 14 '22 06:12

scantwell71


1 Answers

If you only want some code to be executed when the user changes the combobox you can subscribe to SelectionChangeCommitted instead of SelectionChanged. "SelectionChangeCommitted " doesn't get called when the combobox selection is changed programmatically.

like image 174
Chris Bennet Avatar answered Jan 04 '23 13:01

Chris Bennet