List Box Width Can Be Only 14-55 Characters in 7.1 UI Toolbox (59724)



The information in this article applies to:

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

This article was previously published under Q59724

SUMMARY

The ListBox() function of the WINDOW.BAS toolbox file takes two parameters: a string array containing the list of items to be displayed, and an integer variable containing the number of items in the list.

The header comment of the ListBox function describes how to add a third parameter, an integer variable (BoxWidth%) that contains the desired width of the list box to be displayed. Unless this parameter is added, the width of the list box always defaults to 14 characters. However, even if this parameter is given, the width cannot be less than 14 or greater than 55 characters. The ListBox function ensures that the width is within this range.

This information applies to the User Interface (UI) Toolbox in Microsoft Basic Professional Development System (PDS) versions 7.0 and 7.1 for MS-DOS.

MORE INFORMATION

After adding the modification that allows the desired list box width to be specified, a sample invocation of the ListBox function would be as follows:
   x% = ListBox(text$(),MaxRec%,BoxWidth%)
				
where:
   x%         is the array element selected from the list box
   text$()    is the string(s) to display in the list box
   MaxRec%    is the number of strings to display in the list box
   BoxWidth%  is the desired width of the list box
				
If BoxWidth% is less than 14, ListBox changes it to 14. If BoxWidth% is greater than 55, ListBox changes it to 55. The statements that perform these checks are located toward the end of the function under the subroutine heading ListBoxWidthCalc:
   IF BoxWidth < 14 THEN BoxWidth = 14
   IF BoxWidth < 55 THEN BoxWidth = 55
				
It is NOT recommended that you change or delete these IF statements to allow any list box width. If the width is too small, the OK and Cancel buttons may not fit in the list box. If the width is too large, the resulting list box may not fit on the screen.

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