Microsoft KB Archive/249622

From BetaArchive Wiki

Article ID: 249622

Article Last Modified on 1/5/2000



APPLIES TO

  • 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 Q249622

SYMPTOMS

When trying to use WhatsThisHelp to display the help for an object within a grid, the help topic for that object is not displayed. Instead, the help topic for the grid is displayed. If there is not a help topic assigned to the WhatsThisHelpID for the grid, one of these two messages may appear:

No help topic is associated with this item.

or

Cannot find the requested help topic. This link may be incorrectly authored. Use the search or the index to find the topic.

RESOLUTION

The following code displays the help topic for the text box control when one of the first three columns of the grid is clicked on using WhatsThisHelp. Otherwise it sets the WhatsThisHelpID to show the help for the grid. Add more CASE statements to continue showing help for the rest of the columns in the grid.

     NODEFAULT
     DO CASE
        CASE MCOL(THISFORM.NAME,3) > 18 + THIS.LEFT AND ;
              MCOL(THISFORM.NAME,3) <= 18 + THIS.LEFT +  ;
              THIS.column1.WIDTH
            nWhatsThisHelpID  = 1342177844 && help topic number of textbox.
        CASE MCOL(THISFORM.NAME,3) > 18 +THIS.LEFT +THIS.column1.WIDTH ;
              AND MCOL(THISFORM.NAME,3) <= 18 +THIS.LEFT + ;
              THIS.column1.WIDTH + THIS.column2.WIDTH
             nWhatsThisHelpID = 1342177844 
        CASE MCOL(THISFORM.NAME,3) > 18 +THIS.LEFT +THIS.column1.WIDTH ;
              + THIS.column2.WIDTH AND MCOL(THISFORM.NAME,3) <= 18 ;
              + THIS.LEFT + THIS.column1.WIDTH + THIS.column2.WIDTH + ;
               THIS.column3.WIDTH
             nWhatsThisHelpID = 1342177844  
        OTHERWISE
             nWhatsThisHelpID = 1342177839 && help topic number of grid.
     ENDCASE
     DODEFAULT(nWhatsThisHelpID)

MORE INFORMATION

Steps to Reproduce Behavior


  1. Create a form, add a table to the Data Environment, and click on the title of the table and drag it to an area of the form to create a grid.
  2. Set the following properties of the form:

MaxButton = .F.
MinButton = .F.
WhatsThisButton = .T.
WhatsThisHelp = .T.

  1. Set the WhatsThisHelpID of the grid to the number 1342177839.
  2. Set the WhatsThisHelpID of the grid's first column's text box to 1342177844.
  3. Run the form and click on the WhatsThisHelp question mark in the upper right corner of the form and then click on the text box in column one of the grid. Notice that the Visual FoxPro help comes up showing the grid help topic.
  4. Close the form, modify it, and add the code in the Resolution section of this article to the grid's ShowWhatsThis method.
  5. Run the form and click on the WhatsThishelp question mark and then click on any one of the first three columns in the grid. Note that the text box help appears. Clicking anywhere else on the grid brings up the help for the grid control.


Keywords: kbcodesnippet kbdesigner kbcontainer kbprb kbctrl kbpending KB249622