XL: Cannot Set Default Button Property on a Custom Dialog Box

Last reviewed: March 27, 1997
Article ID: Q141223
5.00 5.00c 7.00 WINDOWS kbprb

The information in this article applies to:

  • Microsoft Excel for Windows, version 5.0, 5.0c
  • Microsoft Excel for Windows 95, version 7.0

SYMPTOMS

When you set the default property of a button on a custom dialog sheet, the property may not have the focus when the dialog box is shown.

CAUSE

The default property depends on the tab order of the controls on your dialog sheet. If there is an editable control (for example an edit box, an option button, or a check box) listed before the first button on the list in the Tab Order dialog box, then the button you set as the default will be the default. However, if you have only non-editable items (for example labels or group boxes) before the first button in the Tab Order dialog box, or if you have only buttons in your dialog box, then the default button is always the button that is the first in tab order, regardless of whether it is set as the default button or not.

WORKAROUND

To work around this behavior, use one of the following methods:

Method 1: If you have only non-editable items and/or buttons in your

          custom dialog box:

          a. From the dialog sheet, click Tab Order on the Tools menu.

          b. Select the button you want to be the default button, and click
             the move up button until the desired button is the first
             button in the list.

Method 2: If you have editable items in your custom dialog box:

          a. From the dialog sheet, click Tab Order on the Tools menu.

          b. Select the editable item you want have the focus, and then
             move this item up with the move up button until it is before
             the first button on the list.

STATUS

Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.


KBCategory: kbprb
KBSubcategory: xlwin

Additional reference words: 5.00 5.00c 7.00
Keywords : xlwin kbprb
Version : 5.00 5.00c 7.00
Platform : WINDOWS


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: March 27, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.