Microsoft KB Archive/95942

= HelpSetOptions Sets Visible Property to False on Wrong Button =

PSS ID Number: 95942

Article Last Modified on 1/8/2003

-

The information in this article applies to:


 * Microsoft Visual Basic for MS-DOS 1.0

-



This article was previously published under Q95942



SYMPTOMS
The HelpSetOptions function in the Help Toolkit sets the Visible property on the wrong button when passed a Flags parameter greater than 2.



WORKAROUND
To work around the problem, load the HELP.MAK project, change the code in the procedure HelpSetOptions as shown below. To rebuild HELP.QLB and HELP.LIB, from the Run menu, choose Make Library.

Change: If (Flags AND 2 ^ (i + 3)) = FALSE THEN

to: If (Flags AND 2 ^ (i + 2)) = FALSE THEN



STATUS
Microsoft has confirmed this to be a bug in the Professional Edition of Microsoft Visual Basic version 1.0 for MS-DOS. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.



MORE INFORMATION
The flags parameter to the HelpSetOptions procedure is a bitwise value controlling the Visible status of the five command buttons on the help button bar and also controls two other options. The following table shows the values to set these options.  Function                  Value   Default ESC closes Help            1     0 (ESC key does not close help window) UNLOAD Help at Form close  2     0 (Help form made invisible, not                                       unloaded when form is closed) No Contents Button         4     0 (Contents button is visible) No Search Button           8     0 (Search button is visible) No Back Button            16     0 (Back button is visible) No History Button         32     0 (History button is visible) No Copy Button            64     0 (Copy button is visible)

Steps to Reproduce Problem
 Invoke VBDOS.EXE with the HELP.QLB Quick library by typing the following at the command prompt:

VBDOS /L HELP.QLB

 From the File menu, choose New Form (ALT, F, F). Form1 is created by default. From the Window menu, choose Menu Design Window (ALT, W, M). Create a top level menu with the following properties:

Caption = &Help

CtlName = mHelp

 Create a sub-menu item under &Help with the following properties:

Caption = &Contents

CtlName = mHelpContents

</li> Press the Done button (ALT+D) to close the Menu Design Window.</li> From the File menu, choose Exit (ALT, F, X). Save all changes.</li>  Add the following code to the module level code of Form1: Rem $INCLUDE: 'HELP.BI'   ' Load Help include file Dim SHARED HelpLoaded%    ' Flag indicating success of Help load </li>  Add the following code to the Form_Load event of Form1: Sub Form_Load HelpRegister &quot;HELPDEMO.TXT&quot;, HelpLoaded% End Sub HELPDEMO.TXT is a sample help file shipped with Visual Basic. </li>  Add the following code to the Form_Unload event of Form1: Sub Form_Unload (Cancel AS INTEGER) HelpClose 'So that Help closes the hidden window it leaves up. End Sub </li>  Add the following code to mHelpContents_Click event: Sub mHelpContents_Click If HelpLoaded% Then ' Ensure that Help was loaded successfully Flags% = 16 + 64 ' Hide the Back and Copy Buttons HelpSetOptions 3, 0, 7, 0, 7, 11, Flags% HelpshowTopic &quot;Contents&quot; End If      End Sub </li> From the Run menu, choose Start (ALT, R, S) to run the program.</li> From the Help menu, choose Contents.</li></ol>

The Visual Basic for MS-DOS help engine loads and displays the help file HELPDEMO.TXT. Two of the five buttons on the button bar are invisible due to the Flags parameter passed to HelpSetOptions. However, the wrong buttons are invisible. Instead of the Back and Copy buttons being invisible, the Search and History buttons are invisible.

Additional query words: VBmsdos buglist1.00 1.00

Keywords: KB95942

Technology: kbAudDeveloper kbVB100DOS kbVBSearch kbZNotKeyword3

-

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

© 2004 Microsoft Corporation. All rights reserved.