I have a windows form that has an OK and Cancel button. I have set
them as the form's AcceptButton and CancelButton respectively. Every
now and again when I run my program I find that they do not work when I
hit Enter and Esc. I go back to Visual Studio and I see that the
AcceptButton and CancelButton properties are no longer set. Any idea
what may be causing this?

Re: Form Loses AcceptButton Property by Forrest

Forrest
Fri Dec 01 01:30:17 CST 2006


Uzytkownik <taurin423@gmail.com> napisal w wiadomosci
news:1164903029.702010.90290@16g2000cwy.googlegroups.com...
>I have a windows form that has an OK and Cancel button. I have set
> them as the form's AcceptButton and CancelButton respectively. Every
> now and again when I run my program I find that they do not work when I
> hit Enter and Esc. I go back to Visual Studio and I see that the
> AcceptButton and CancelButton properties are no longer set. Any idea
> what may be causing this?
>

Check your buttons properteis and change for OK_button properties
DialogResult on OK and Cancel_Button on Cancel.
It will be work fine

Forrest