Microsoft KB Archive/155188

= BUG:Tabbing into Option Group Does Not Select Correct Option =

Article ID: 155188

Article Last Modified on 5/12/2003

-

APPLIES TO


 * Microsoft Visual FoxPro 3.0 Standard Edition
 * Microsoft Visual FoxPro 3.0b Standard Edition
 * Microsoft Visual FoxPro 5.0 Standard Edition
 * Microsoft Visual FoxPro 5.0a
 * Microsoft Visual FoxPro 6.0 Professional Edition

-



This article was previously published under Q155188



3.00 3.00b WINDOWS kbother kbdisplay



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.



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.

Additional query words: kbdsd vfoxwin kbvfp300 kbvfp300b kbvfp500 kbvfp500a kbvfp600

Keywords: KB155188

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.