The information in this article applies to:
SYMPTOMSIf the Multiselect property of a list box is set to Simple or Extended (1 or 2), the ListIndex property returns 0 for an empty list box or a filled list box with nothing selected. It should return -1. When the Multiselect property of a list box is set to 0 (None), the ListIndex correctly returns -1 under these same conditions. WORKAROUNDTo detect whether the first item in a list box is selected, with Multiselect set to 1 or 2, test the Selected property as well as the Listindex property. For example, with multiselect set to 1 or 2, the following code will give a message box only if the first item in the list box is selected:
STATUSMicrosoft has confirmed this to be a bug in Visual Basic Version 3.0 for Windows. This problem was corrected in Visual Basic Version 4.0. MORE INFORMATIONSteps to Reproduce Problem
Additional query words: 3.00 buglist3.00 fixlist4.00
Keywords : |
Last Reviewed: January 25, 2000 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |