views:

354

answers:

2

Hello. 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.

+4  A: 

Try this.AcceptButton = null;

John Saunders
emm...yes - that worked. Thank you. ...can't believe I didn't try that myself!!.
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
A: 

Try this.AcceptButton = Nothing;

Rashid Farooq