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

ID: Q141223

5.00 5.00c 7.00 WINDOWS kbprb

The information in this article applies to:

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 
Version           : 5.00 5.00c 7.00
Platform          : WINDOWS

Last Reviewed: March 30, 1997