Microsoft KB Archive/299746

= PRB: F1 Help Does Not Work With Focus on OLEControls =

Article ID: 299746

Article Last Modified on 5/10/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
 * Microsoft Visual FoxPro 7.0 Professional Edition

-



This article was previously published under Q299746



SYMPTOMS
When you have focus on an OLEControl on a form and you press F1 to start Help, nothing happens.



RESOLUTION
ON KEY LABEL F1 HELP starts the Help file, even if focus is on an OLEControl.



Steps to Reproduce Behavior
  Run the following code from a program (.prg) file. *!* Q299746 PRB: F1 Help Doesn't Work With OLEControls loForm = CREATEOBJECT(&quot;testForm&quot;) loForm.Show(1)

DEFINE CLASS testForm AS Form

Top = 10 Left = 10 Height = 150 Width = 200 Caption = &quot;OLEControl Help form&quot; ADD OBJECT oleTest AS oleControl WITH ; Top = 10, ; Left = 10, ; Height = 120, ; Width = 80, ; OLEClass = &quot;MSComctLlib.TreeCtrl&quot;, ; Name = &quot;oleTest&quot; ADD OBJECT cmdTest AS commandbutton WITH ; Top = 50, ; Left = 100, ; Caption = &quot;OK&quot;, ; Name = &quot;cmdTest&quot; PROCEDURE Init *!* Replace the file below with an appropriate help file *!* for your system. SET HELP TO d:\vfp3\foxhelp.hlp *!* Uncomment the next line for the workaround. *!* ON KEY LABEL F1 HELP ENDPROC ENDDEFINE  Note that the focus is on the TreeView control and press F1. Nothing happens. Press TAB to move the focus to the command button, and press F1 again. The Help file that you specified in Form.Init starts. Close the form, uncomment the ON KEY LABEL statement in the Init method, and run the program again. This time Help starts no matter which control has the focus.

Keywords: kbcodesnippet kbprb kbctrl KB299746

-

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

© Microsoft Corporation. All rights reserved.