开发者

Delayed Control Events

I have a weird delayed/off mapping event issue with a few controls within my UserControl. The UserControl has 2 textboxes and 1 button. When I click on the button, nothing happens. When tab to the next control. The focus goes somewhere I can't see, but all the event for th开发者_如何学运维e button work there. I can hit the space bar and it fires with Button.click event. The same thing happens to the textboxes. I can type anything in the box I can see. Then hit tab, it goes to the box I can't see and all the events work. I went over all my code and I can't find anything that would suggest there are 2 controls on there..

Anyone have any suggestions on how to fix this??


Just figured it out... I copied some code into the New Constructor.. and in the code, I had an extra InitializeComponent()... which cause all the problems!


make sure you are handling the click event of the button and not the LostFocus event. your description of the problem sounds like you're handling the lost focus event since the event fires when you hit tab to navigate away from the button

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜