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方法确定窗体上的哪个按钮引发其 Click 事件,当用户按 ENTER,根据以下优先级: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.

适用于

另请参阅