开发者

I have to click twice to fire an event

开发者 https://www.devze.com 2022-12-29 17:17 出处:网络
I\'m developing a windows form appli开发者_Go百科cation in C# and (SOMETIME) every button in the form need to be clicked twice to fire an event.

I'm developing a windows form appli开发者_Go百科cation in C# and (SOMETIME) every button in the form need to be clicked twice to fire an event.

Can anybody suggest a solution?

Best Regards, BaDoOoReY


Its a win form application. I think you have handled button_doubleClicked event instead of Button_Clicked event. Please make sure that you handle Button_Clicked event. If this is not the case then can you please share your code ??


You can create a puplic variable with 0 value.

When the user click the button for the first time you give the varriable value 1.

When the user click the button for the second time you give the varriable value 2.

and you make if statement to check if the varriable is equal 2, this mean that the button clicked twice, if true you can fire your event.

Also you can you use button double_cilck event.


I think roundtrip is not happening some times because of any ajax control or javascript.If you use any of these two please check this may stops events to fire server side some times.

0

精彩评论

暂无评论...
验证码 换一张
取 消