Excel: Setting the Focus in a Custom Dialog BoxLast reviewed: November 3, 1994Article ID: Q71298 |
The information in this article applies to:
SUMMARYBy default, the focus of a dialog box will be the first item listed in the dialog box description unless a default OK or default Cancel button is used. The default button will then have the focus instead of the first item listed. However, it is possible to override or change these defaults and specify which item you prefer to have as the focus when the dialog box is displayed. Note that in Microsoft Excel version 5.0, you can control the focus in a dialog box by using the Tab Order dialog box in the dialog sheet. For more information about the tab order in a dialog box in Microsoft Excel version 5.0, query on the following words in the Microsoft Knowledge Base:
tab and order and defaultbutton MORE INFORMATIONThe focus can be set to another item by placing a number in the Init/Result column of the first row of the dialog definition. This number should correspond to the position of the preferred item in the dialog definition. Items are numbered starting with 1 and beginning with the second row of the dialog box definition table. For example, placing a number 2 in the Init/Result column of the first line will cause the item located in the third row of the dialog definition to be selected when the dialog box is displayed. You will not be able to set the focus to items that are not editable, or can be chosen such as buttons or check boxes. The dialog definition always contains one or more rows and seven columns. The Init/Result column is always the seventh column in the dialog definition.
REFERENCES"Microsoft Excel User's Guide 2," version 4.0, page 281 "Microsoft Excel User's Guide," version 3.0, page 640
|
KBCategory: kbusage
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |