How to “Unset” Event

前端 未结 5 1100
醉酒成梦
醉酒成梦 2021-01-19 15:10

If I have a combobox click event set in the designer.cs page and then at some point during the running of the program, based on some condition, I no longer want the combobox

5条回答
  •  南方客
    南方客 (楼主)
    2021-01-19 15:42

    Use the -= operator.

    this.MyEvent -= MyEventHandler;
    

    Your question indicates you don't have a good understanding of events in c# - I suggest looking deeper into it.

提交回复
热议问题