2

To set a form's AcceptButton at runtime, I'm doing this:

this.AcceptButton = this.btnButtonName;

But can anyone tell me how to clear the form's AcceptButton, something like:

this.AcceptButton = None; 

Thanks.

1 Answers1

6

Try this:

this.AcceptButton = null;
reformed
  • 4,505
  • 11
  • 62
  • 88
John Saunders
  • 160,644
  • 26
  • 247
  • 397
  • emm...yes - that worked. Thank you. ...can't believe I didn't try that myself!!. –  Mar 11 '09 at 15:00
  • If I had been in a bad mood, I might have suggested you comment out the line "this.AcceptButton = this.btnButtonName;", then look to see what the value was; then set it to that value at runtime. But I thought better of it. ;-) – John Saunders Mar 11 '09 at 15:02