ComboBox myComboBox = new ComboBox ( ) ;
myComboBox. SelectedIndexChanged += new System . EventHandler ( this . MyComboBox_SelectedIndexChanged ) ;
SelectedIndexChanged
event occurs even if the user did not select anything in the ComboBox, and the index was changed by your own code (for example, you added several elements and selected the last one). The output will be a subscription to the SelectionChangeCommitted
event:myComboBox.SelectionChangeCommitted += new System.EventHandler(this.cbLookIn_SelectionChangeCommitted);
Source: https://habr.com/ru/post/87512/
All Articles