Form.UpdateDefaultButton Form.UpdateDefaultButton Form.UpdateDefaultButton Form.UpdateDefaultButton Method

定义

更新哪个按钮为默认按钮。Updates which button is the default button.

protected:
 override void UpdateDefaultButton();
protected override void UpdateDefaultButton ();
override this.UpdateDefaultButton : unit -> unit
Protected Overrides Sub UpdateDefaultButton ()

注解

UpdateDefaultButton方法确定窗体上的哪个按钮在用户按下 enter 键时引发其 Click 事件,具体取决于以下优先级:The UpdateDefaultButton method determines which button on the form raises its Click event when the user presses ENTER, according to the following priority:

  1. 如果该ActiveControl属性IButtonControl实现接口,则该控件为默认按钮。If the ActiveControl property implements the IButtonControl interface, that control is the default button.

  2. AcceptButton属性为默认按钮。The AcceptButton property is the default button.

适用于

另请参阅