Microsoft KB Archive/318970

= FIX: Bound OptionButton Might Not Appear Checked in the Accessible Event Watcher =

Article ID: 318970

Article Last Modified on 5/17/2002

-

APPLIES TO


 * Microsoft Visual FoxPro 7.0 Professional Edition

-



This article was previously published under Q318970



SYMPTOMS
If you have an OptionGroup that contains OptionButton controls that are bound to a table or cursor fields, the Accessible Event Watcher from the Microsoft Active Accessibility SDK may not correctly reflect the &quot;checked&quot; state of the OptionButton controls. Screen readers or other accessibility aids that use Microsoft Active Accessibility may also be similarly affected. For example, the Accessible Event Watcher may display the following: OBJ_FOCUS Name=&quot;Option1&quot; Role=radio button State=focused,focusable Instead, the Accessible Event Watcher should display the following: OBJ_FOCUS Name=&quot;Option1&quot; Role=radio button State=focused,checked,focusable



RESOLUTION
To resolve this problem, obtain the latest service pack for Visual FoxPro for Windows 7.0. For additional information, click the following article number to view the article in the Microsoft Knowledge Base:

316964 How to Obtain the Latest Visual FoxPro for Windows 7.0 Service Pack



STATUS
Microsoft has confirmed that this is a problem in Microsoft Visual FoxPro for Windows 7.0.

This problem was first corrected in Visual FoxPro for Windows 7.0 Service Pack 1.



Steps to Reproduce the Behavior
 Download the following files from Microsoft Active Accessibility 2.0 SDK Tools (http://www.msdn.Microsoft.com/downloads/default.asp?URL=/downloads/sample.asp?url=/msdn-files/027/001/785/msdncompositedoc.xml), and then save them in the same folder:  Accevent32.exe Event32.dll

  Paste the following code in a program (.prg) file, and then run the program from the Command window: PUBLIC oMyForm AS FORM CREATE CURSOR MyCursor (F1 m, L1 l, L2 l) APPEND BLANK REPLACE L1 WITH .T., L2 WITH .F. oMyForm = NEWOBJECT(&quot;MyFormClass&quot;) oMyForm.SHOW

DEFINE CLASS MyFormClass AS FORM AUTOCENTER = .T.   ADD OBJECT Text1 AS TEXTBOX ADD OBJECT Optiongroup1 AS OPTIONGROUP WITH TOP = 150, ; BUTTONCOUNT = 2, ; HEIGHT = 50, ; WIDTH = 150, ; Option1.CAPTION = &quot;Option1&quot;, ; Option2.CAPTION = &quot;Option2&quot;, ; Option1.CONTROLSOURCE = &quot;MyCursor.L1&quot;, ; Option2.CONTROLSOURCE = &quot;MyCursor.L2&quot;

PROCEDURE Optiongroup1.INIT THIS.SETALL(&quot;AutoSize&quot;,.T.) *!* THIS.SETALL(&quot;ControlSource&quot;,&quot;&quot;) ENDPROC PROCEDURE DESTROY USE IN SELECT(&quot;MyCursor&quot;) ENDPROC ENDDEFINE </li> Run the Accessible Event Watcher (AccEvent32.exe), and then return to the form in Visual FoxPro.</li> Press the TAB key to change between the TextBox and the OptionGroup.</li>  Return to AccEvent32.exe and note that the output window contains entries such as the following: <pre class="fixed_text">OBJ_FOCUS   Name=&quot;Text1&quot; Role=editable text State=focused,focusable OBJ_FOCUS   Name=&quot;Option1&quot; Role=radio button State=focused,focusable </li>  Return to Visual FoxPro and exit the form. Uncomment the commented SetAll function call in the OptionGroup Init event, and then run the program again. This unbinds the option buttons, and gives you the following output in Accessible Event Watcher: <pre class="fixed_text">OBJ_FOCUS   Name=&quot;Text1&quot; Role=editable text State=focused,focusable OBJ_FOCUS   Name=&quot;Option1&quot; Role=radio button State=focused,checked,focusable </li></ol>

Keywords: kbbug kbfix kbvfp700sp1fix kbcodesnippet KB318970

-

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

© Microsoft Corporation. All rights reserved.