Microsoft KB Archive/158830

= FIX: OptionGroup with M, P, H, K Hot Keys Fire Valid =

Article ID: 158830

Article Last Modified on 9/30/2003

-

APPLIES TO


 * Microsoft Visual FoxPro 3.0b Standard Edition

-



This article was previously published under Q158830



SYMPTOMS
If an OptionGroup control has the alphabetic characters "M," "P," "H," and "K," as hot keys, and the user moves through the OptionGroup using the direction (or arrow) keys, the Valid event fires.



WORKAROUND
For the Option button that has "M" as the hot key, add the following command to the GotFocus of this Option button: ON KEY LABEL RIGHTARROW KEYBOARD '{DNARROW}' For the hot key "H," place the following command in the GotFocus: ON KEY LABEL UPARROW KEYBOARD '{LEFTARROW}' For the hot key "K," place the following command in the GotFocus: ON KEY LABEL LEFTARROW KEYBOARD '{UPARROW}' For the hot key "P," place the following command in the GotFocus: ON KEY LABEL DNARROW KEYBOARD '{RIGHTARROW}' Then add the ON KEY command to the LostFocus of each Option button to restore all keys to their default behavior.



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



MORE INFORMATION
If the option button has a hot key that begins with an "M," pressing the right-arrow key fires the Valid event of the option button. If the hot key is an "H," the up-arrow fires the Valid. If the hotkey is a "K," the left- arrow fires the Valid, and if it is a "P," the down-arrow fires the Valid. In addition, when the option button uses these hot keys, the focus does not leave that particular option button when pressing the arrow key that fires the Valid.

Steps to Reproduce Behavior
 Create a form. Add an OptionGroup control to the form from the Form Controls toolbar. Change the ButtonCount property to four in the Property sheet. Click the OptionGroup control to select it, then right-click it to bring up the shortcut menu. Click Edit. In the OptionGroup, click on the Option1 button. Change the Caption property to \  Open the Valid event from the Methods tab of the Property sheet. Enter the following: WAIT WINDOW "Here in valid" TIMEOUT 1 </li></ol>

Repeat steps 4 through 6, but enter \<H, \<K , and \<P in the Caption property for each of the three remaining option buttons.

Run the form and attempt to move off of each of the option buttons using right-arrow for the "M" hot key, the up-arrow for "H," left-arrow for "K," and down-arrow for "P."

Additional query words: VFoxWin kbdsd

Keywords: kbbug kbfix KB158830

-

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

© Microsoft Corporation. All rights reserved.