Microsoft KB Archive/59724

= List Box Width Can Be Only 14-55 Characters in 7.1 UI Toolbox =

Article ID: 59724

Article Last Modified on 8/16/2005

-

APPLIES TO


 * Microsoft BASIC Professional Development System 7.0
 * Microsoft BASIC Professional Development System 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.

Additional query words: BasicCom

Keywords: KB59724

-

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

© Microsoft Corporation. All rights reserved.