Hi all,
I have a little program written in C#. I got two forms. On the first
one there is a button with an event, which opens the second form and
hides itself. On this second form there is a button (on the same
position as on the first form).
When I click the button on the first form two times accidentally, the
event will be fired in the second form after it is loaded. Is it
possible to delete all previous events before a form is ready?
Thanks for your help!
Ginny Caughey [MVP] - 31 Aug 2005 16:44 GMT
Gebbi,
Probably the easiest way to prevent double-clicking a button is to disable
the button in its Click event handler, then re-enable it when you want it to
be active again. For example, you might want to disable the button on the
second form until you are ready to start receiving Click events by setting
the Enabled property to false in the form designer, then setting it to true
in your FormLoad event handler. Or disable the button on the first form
after it has been clicked once. Without seeing your app, I'm only guessing
what would be the best strategy for you.
Ginny Caughey
.NET Compact Framework MVP
> Hi all,
>
[quoted text clipped - 8 lines]
>
> Thanks for your help!