Microsoft KB Archive/74132

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

Article ID: 74132

Article Last Modified on 11/18/2003

-

APPLIES TO


 * Microsoft Visual Basic 1.0 Standard Edition
 * Microsoft Windows 3.0 Standard Edition
 * Microsoft Windows 3.1 Standard Edition

-



This article was previously published under Q74132



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.



Steps to Reproduce Problem
 In the Visual Basic environment, choose New Project from the File menu. Place two list boxes or two combo boxes on the form. 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 &quot;'Sorted' property cannot be set at run time.&quot;  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 &quot;[&quot;        Combo1.AddItem &quot;[&quot; List1.AddItem &quot;\&quot;        Combo1.AddItem &quot;\&quot; List1.AddItem &quot;a&quot;        Combo1.AddItem &quot;a&quot;

List2.AddItem &quot;a&quot;        Combo2.AddItem &quot;a&quot; List2.AddItem &quot;\&quot;        Combo2.AddItem &quot;\&quot; List2.AddItem &quot;[&quot;        Combo2.AddItem &quot;[&quot; End Sub                  End Sub  Run the code by pressing the F5 function key or choosing Start from the Run menu. Click the form to see the sequence &quot;a [ \&quot; in the first list box or combo box and to see the different sequence &quot;[ \ a&quot; in the second list box or combo box.</li></ol>

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

Additional query words: noupd buglist3.00 buglist3.10 3.00 3.10

Keywords: kbbug KB74132

-

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

© Microsoft Corporation. All rights reserved.