BUG: [ Character May Sort Incorrectly in List or Combo Box

Last reviewed: June 21, 1995
Article ID: Q74132
The information in this article applies to:
  • Microsoft Visual Basic programming system for Windows, version 1.0
  • Microsoft Windows, versions 3.0 and 3.1

SYMPTOMS

An example below demonstrates a problem using the Sorted property to sort a string beginning with a bracket ([) in either a list box or combo box in Microsoft Visual Basic version 1.0 for Windows.

STATUS

This sorting problem is caused by Microsoft Windows versions 3.0 or 3.1, not by Visual Basic. Microsoft is researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

Steps to Reproduce Problem

  1. In the Visual Basic environment, choose New Project from the File menu.

  2. Place two list boxes or two combo boxes on the form.

  3. From the Properties Bar, set the Sorted property for either the two list boxes or two combo boxes to True.

    Note: Do not invoke List1.Sorted = -1 within the code of an event procedure because this causes the run-time error "'Sorted' property cannot be set at run time."

  4. Now add some code to the Form_Click event procedure. Below are two separate examples of the code to add depending on if you are using list boxes or combo boxes:

       Sub Form_Click ()         Sub Form_Click ()
          List1.AddItem "["         Combo1.AddItem "["
          List1.AddItem "\"         Combo1.AddItem "\"
          List1.AddItem "a"         Combo1.AddItem "a"
    
          List2.AddItem "a"         Combo2.AddItem "a"
          List2.AddItem "\"         Combo2.AddItem "\"
          List2.AddItem "["         Combo2.AddItem "["
       End Sub                   End Sub
    
    

  5. Run the code by pressing the F5 function key or choosing Start from the Run menu.

  6. Click the form to see the sequence "a [ \" in the first list box or combo box and to see the different sequence "[ \ a" in the second list box or combo box.

This reveals an inconsistency with an internal Windows 3.0 sorting routine. If you replace the character "[" with the character "b", the two boxes correctly sort in the same order: "\ a b". The problem is with sorting the "[" character.


Additional reference words: noupd buglist3.00 buglist3.10 1.00 3.00 3.10
KBCategory: kbprg kbbuglist
KBSubcategory: PrgCtrlsStd


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: June 21, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.