Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
具有以下内容:
this.AcceptButton = this.OKButton; this.OKButton.Enabled = false;
...当用户按下 Enter 时,是否仍会调用 OK 按钮单击处理程序?
不,它不会被调用。
不,当按钮被禁用时,它不会激活并触发该事件。
-亚当
AcceptButton/CancelButton 只需调用按钮的 PerformClick() 方法...如果控件被禁用,则该方法不会运行。