List Box in Basic PDS UI Toolbox Shows Focus Incorrectly (73695)



The information in this article applies to:

  • Microsoft Basic Professional Development System for MS-DOS 7.1
  • Microsoft Basic Professional Development System for MS-DOS 7.0

This article was previously published under Q73695

SYMPTOMS

Within the User Interface (UI) Toolbox, toggling between the buttons of the list box will at times highlight the incorrect item that has the focus. When the CANCEL button is highlighted and you press the TAB key, focus is set correctly to the list box, yet the OK button is incorrectly highlighted. This may give you the false impression that you can only select the list box with the mouse and not the keyboard. By changing the code in WINDOW.BAS, you can correct this problem as shown below.

STATUS

Microsoft has confirmed this to be a bug in the User Interface (UI) Toolbox provided with Microsoft Basic Professional Development System (PDS) for MS-DOS, versions 7.0 and 7.1. A correction to this problem is provided below.

MORE INFORMATION

To correct the problem, do the following:
  1. Load WINDOW.BAS into the QBX.EXE environment.
  2. Search for the LISTBOX function. The LISTBOX function is declared as follows:
          FUNCTION LISTBOX (text$(), MaxRec)
    						
  3. Locate the case statement within the LISTBOX function.
  4. Case 7 is documented in the following manner:
        CASE 7
           SELECT CASE currButton
              CASE 0
                 currButton = 2
              CASE 2
                 ButtonToggle 2
                 ButtonToggle 3
                 currButton = 3
              CASE 3
                 ButtonToggle 2
                 ButtonToggle 3
                 currButton = 0
           END SELECT
    						
    Change the case statement so that it reads:
        CASE 7
           SELECT CASE currButton
              CASE 0
                 ButtonToggle 2
                 currButton = 2
             CASE 2
                 ButtonToggle 2
                 ButtonToggle 3
                 currButton = 3
              CASE 3
                 ButtonToggle 3
                 currButton = 0
           END SELECT
When you make the above change, you must also change the following (near the top of WINDOW.BAS):
   ButtonOpen 2, 2, "OK", 16, 6, 0, 0, 1
				
to the following instead:
   ButtonOpen 2, 1, "OK", 16, 6, 0, 0, 1
				
The program is now corrected. To use the correct version of WINDOW.BAS, you will need to make a new UITBEFR.LIB and UITBEFR.QLB. Run the following commands at the MS-DOS prompt or from a batch file. Be sure that your path is correctly set to access the LIB.EXE, BC.EXE, and the LINK.EXE files included in the Microsoft Basic PDS. Make sure that QBXQLB.LIB and QBX.LIB are in the directory in which you are working, or that they are accessible with your LIB environment variable in MS-DOS. UIASM.OBJ must also be in your working directory.
   bc /x/fs general.bas;
   bc /x/fs window.bas;
   bc /x/fs mouse.bas;
   bc /x/fs menu.bas;
 
   lib uitbefr.lib+ general+ mouse+ window+ menu+ uiasm+ qbx.lib;
   link /q uitbefr.lib, uitbefr.qlb,,qbxqlb.lib;
				

Modification Type:MinorLast Reviewed:8/16/2005
Keywords:KB73695 kbAudDeveloper