Event Handler performance

前端 未结 4 531
礼貌的吻别
礼貌的吻别 2021-02-04 08:59

I have a performance problem. I create 100 new buttons and I want to assign an Click Event Handler. I execute this code for about 100 times:

Buttons[i].Button.Cl         


        
4条回答
  •  有刺的猬
    2021-02-04 09:50

    Try turning off IntelliTrace. Had the exact same symptoms. Blazing fast when not run under Visual Studio, but always added 30ms per btn.Click+= i made if running under Visual Studio.

    So probably IntelliTrace that hooks into the Click events somehow for detailed debugging.

提交回复
热议问题