FIX: Problem Setting Focus to a Combobox from a PageFrame

ID: Q141395

3.00 3.00b WINDOWS kbprg kbbuglist kbfixlist

The information in this article applies to:

  • Microsoft Visual FoxPro for Windows, versions 3.0 and 3.0b

SYMPTOMS

After you create the initial instance, you must click twice on a page in a pageframe to set the focus to a combo box.

WORKAROUND

To avoid the problem, use one of these workarounds:

  • Change the tab order of the PageFrame so that it is the last object in the tab order of the form. To do this, click the View menu while the form is open in the From Designer. Click Tab Order, and a window will appear with a message "Shift-click to select tab order." Click within the number box of the form object that you want to be first. Now, while holding down the SHIFT key, click within the number boxes of the remaining objects, saving the PageFrame for last. When finished, click Reorder within the "Shift-click to select tab order" window.

    -or-

  • Add a command button (essentially a dummy control) to the form. In the click event of each page, issue this command:

    THISFORM.COMMAND1.SETFOCUS.

    In the GOTFOCUS method of the command button, issue the command THISFORM.COMBO1.SETFOCUS. The Visible property of the command button may be set to False if you want because it is just acting as a bridge to set the focus to the combo box.

STATUS

Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. This problem has been fixed in Visual FoxPro 5.0 for Windows.

MORE INFORMATION

This behavior appears to be isolated to the following circumstances:

  • The PageFrame is not the last object in the tab order of the form.

    -or-

  • The PageFrame immediately follows the combo box in the tab order of the form.

Steps to Reproduce Problem

1. Create a form and place the following controls on it, in the specified

   order:

   (1) Combo Box   (2) PageFrame   (3) Command Button

2. In the Init event of the form, add this command:

   THISFORM.COMBO1.SETFOCUS.

3. Add the following command to the Click event of pages 1 and 2 of the
   PageFrame:

       THISFORM.COMBO1.SETFOCUS.

4. Run the form, and click the pages of the PageFrame. It will work
   correctly the first time but on subsequent attempts the page must be
   clicked twice to set the focus.

KBCategory: kbprg kbbuglist kbfixlist KBSubcategory: FxprgGeneral VFoxWin buglist3.00 buglist3.00b fixlist5.00 Additional reference words: 3.00 3.00b
Keywords          : kbVFp kbVFp300bbug kbVFp500fix buglist3.00 FxprgGeneral kbbuglist kbfixlist
Version           : 3.00 3.00b
Platform          : WINDOWS


Last Reviewed: February 23, 1997
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.