XL: Static and Dynamic Default Buttons in Dialog Boxes

Last reviewed: February 2, 1998
Article ID: Q105552

The information in this article applies to:

  • Microsoft Excel for Windows, versions 5.0, 5.0c
  • Microsoft Excel for Windows 95, version 7.0
  • Microsoft Excel for Windows NT, version 5.0
  • Microsoft Excel for the Macintosh, version 5.0

SUMMARY

In Microsoft Excel custom dialog boxes, there are two types of default buttons: static and dynamic.

MORE INFORMATION

In custom dialog boxes in Microsoft Excel, you can set one button in a dialog box as the Default button. To set a button as the Default button:

  1. Select the button that you want to be the Default button.

  2. From the Format menu, choose Object.

  3. Select the Control tab.

  4. Select the Default check box.

  5. Choose OK to accept the change.

The Default button is also called the static default button. Pressing the ENTER key will activate the Default button only if no other button has the focus. Other buttons in the dialog box are called dynamic default buttons. Pressing the ENTER key will activate a dynamic default button only if that button currently has the focus.

If you have a dialog box that contains multiple controls, such as those listed here, pressing ENTER when a control has the focus will either activate the Default button or it will activate another button.

    If this control has the Focus   Pressing ENTER Activates this control
    ---------------------------------------------------------------------

    DefaultButton                   DefaultButton
    Button2                         Button2
    Button3                         Button3
    EditBox1                        DefaultButton
    CheckBox1                       DefaultButton
    CheckBox2                       DefaultButton
    ListBox1                        DefaultButton
    DropDown1                       DefaultButton

In Microsoft Excel for Windows, Windows 95, and Windows NT, if you want a specific control to have the focus when you display a dialog box, you can set the Tab Order of the dialog box so that the control is at the top of the Tab Order. To access the Tab Order dialog box:

  1. From the Tools menu, choose Tab Order.

  2. Select the desired control from the Tab Order list.

  3. Choose the Move Up or Move Down button.

  4. Choose the OK button.

REFERENCES

"Visual Basic User's Guide," version 5.0, page 228-229


Additional query words: 5.00 5.00a 5.00c 7.00
Keywords : kbtlc
Version : WINDOWS: 5.0, 5.0c, 7.0; MACINTOSH: 5.0
Platform : MACINTOSH WINDOWS
Issue type : kbinfo


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: February 2, 1998
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.