Wednesday, 6 May 2015

Stop comboBox's selectedIndexChanged event from firing when the form loads

You can simply unbind the SelectedIndexChanged event, call your fill function and bind the SelectedIndexChanged




this.cmb.SelectionChanged -= new System.EventHandler(this.cmb_SelectionChanged);
cmb.fill(); //Your function
this.cmb.SelectionChanged += new System.EventHandler(this.cmb_SelectionChanged);

No comments:

Post a Comment