ComboBox SelectedIndexChanged event: how to get the previously selected index?

前端 未结 6 1133
闹比i
闹比i 2021-01-17 11:35

I have a user control which has a ComboBox and a SelectedIndexChanged event handler. In the event handler, I need to be able to tell what was the previously selected index.

6条回答
  •  甜味超标
    2021-01-17 11:44

    You can grab & store the old value in the DropDown event. Then revert to that old value in the SelectionChangeCommitted event (if warranted).

提交回复
热议问题