BUG:Tabbing into Option Group Does Not Select Correct Option

Last reviewed: January 10, 1997
Article ID: Q155188
The information in this article applies to:
  • Microsoft Visual FoxPro for Windows, versions 3.0, 3.0b

SYMPTOMS

Tabbing into an Option group does not select the highlighted Option. Rather, it will always go to the first option when you use the TAB key or the last option when you use the SHIFT+TAB KEY combination.

WORKAROUND

The following steps show how to create an Option group that will always select the highlighted Option when tabbing or shift-tabbing into the Option group: (This will allow developers to create Visual FoxPro Forms with Option groups that work the same as Option groups on Visual Basic or Access forms. If you are not familiar with creating and using Visual Classes in Visual FoxPro, please see Chapter 10 in the Microsoft Visual FoxPro Developer's Guide.)

  1. Create a new class named Myoption based on Container.

  2. Set the following properties for the Container:

             Width = 100
            Height = 100
         BackStyle =   0
       BorderWidth =   0
    
    

  3. Add an Option Group to the Container and set the following properties:

    ButtonCount = 3

            Height = 95
             Width = 95
              Left =  2
               Top =  2
    
    

  4. Add the following code to the GotFocus of the Container:

    * Check to see if the TAB or SHIFT+TAB key was used to enter the * container. IF LASTKEY() = 9 OR LASTKEY() = 15

          This.OptionGroup1.Buttons(This.OptionGroup1.Value).SetFocus
    
    ENDIF

  5. Save and close the class.

  6. Create a form and place two Text Boxes and the Myoption class on it.

  7. Run the form, select the middle option in the Option Group, and then use the TAB key to leave and reenter the Option Group.

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.

MORE INFORMATION

Steps to Reproduce Problem

  1. Create a form and place two Text Boxes and an Option Group on it.

  2. Set the ButtonCount in the Option Group to three.

  3. Run the form, select the middle option in the Option Group, and then use the TAB key to leave and reenter the Option Group.


KBCategory: kbother kbdisplay
KBSubcategory: FxotherGeneral
Additional reference words: 3.00 3.00b kbdsd vfoxwin



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