.netwinformsacceptbutton

Is the Windows Forms AcceptButton behavior in effect when the referenced button is disabled?


With the following:

this.AcceptButton = this.OKButton;
this.OKButton.Enabled = false;

... will the OK button click handler still be invoked when the user presses Enter?


Solution

  • No, it won't be invoked.