BUG:Tabbing into Option Group Does Not Select Correct Option (155188)
The information in this article applies to:
- Microsoft Visual FoxPro for Windows 3.0
- Microsoft Visual FoxPro for Windows 3.0b
- Microsoft Visual FoxPro for Windows 5.0
- Microsoft Visual FoxPro for Windows 5.0a
- Microsoft Visual FoxPro for Windows 6.0
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.)
- Create a new class named Myoption based on Container.
- Set the following properties for the Container:
Width = 100
Height = 100
BackStyle = 0
BorderWidth = 0
- Add an Option Group to the Container and set the following properties:
ButtonCount = 3
Height = 95
Width = 95
Left = 2
Top = 2
- 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
- Save and close the class.
- Create a form and place two Text Boxes and the Myoption class on it.
- 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.
Modification Type: | Major | Last Reviewed: | 5/12/2003 |
---|
Keywords: | KB155188 |
---|
|