简体   繁体   中英

How to handle the event fired continuously?

I tried to hook the three events in same name like as below

this.textFontFace.TextChanged += Format_TextChanged;
this.textFontSize.TextChanged += Format_TextChanged;
this.textFontType.TextChanged += Format_TextChanged;

Now, i changed TextBox value for textFontFace , Format_TextChanged method fired three times. I need to fired only one time based on changes made TextBox. How can i handle this? please, help.

It seems you set those event handlers via both designer and code behind. If you clear TextChanged boxes of properties tab from design view you will get rid of the problem.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM