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

ID: Q74132


The information in this article applies to:
  • Microsoft Visual Basic programming system for Windows, version 1.0
  • Microsoft Windows versions 3.0, 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 query words: noupd buglist3.00 buglist3.10 3.00 3.10

Keywords :
Version :
Platform :
Issue type :


Last Reviewed: August 19, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.