UI Toolbox Doesn't Trap PAGE UP or PAGE DOWN Key in Edit Field (74563)



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 Q74563

SYMPTOMS

The User Interface (UI) Toolbox fails to trap a PAGE UP or PAGE DOWN key press inside of an edit field. This article contains information on how to modify the WindowDo subprogram to allow for trapping of the PAGE UP and PAGE DOWN keys in edit fields.

STATUS

Microsoft has confirmed this to be a bug in Microsoft Basic Professional Development System (PDS) for MS-DOS, versions 7.0 and 7.1. A correction for the WindowDo subprogram of WINDOW.BAS is shown below.

MORE INFORMATION

Locate the following lines of code in the WindowDo subprogram of WINDOW.BAS:
   WindoDoEditKbd:
   ...
   SELECT CASE kbd$
      CASE CHR$(13)                          ' Return
      Glostorage.oldDialogEvent = 6
      ExitFlag = TRUE
      ...
				
And change to the following (note that code is only added; no code is changed or deleted):
   WindowDoEditKbd:
   ...
   SELECT CASE kbd$
      CASE CHR$(0) + "I"                      ' PAGE UP key
      Glostorage.oldDialogEvent = 18
      ExitFlag = TRUE
      CASE CHR$(0) + "Q"                      ' PAGE DOWN key
      Glostorage.oldDialogEvent = 19
      ExitFlag = TRUE
      CASE CHR$(13)                            ' Return
      GloStorage.oldDialogEvent = 6
      ExitFlag = TRUE
       ...
				
The WindowDo procedure will exit and the Dialog(0) function will return a value when PAGE UP or PAGE DOWN is pressed in an edit field.

For these changes to take effect, WINDOW.BAS will need to be compiled and the User Interface library will need to be rebuilt. Please refer to the comments in GENERAL.BAS on how to rebuild the User Interface Toolbox linker library (UITB.LIB) and Quick library (UITB.QLB).

Modification Type:MinorLast Reviewed:8/16/2005
Keywords:KB74563