Microsoft KB Archive/262415

= BUG: eVB: Changing the List Property Clears ComboBox Text Area =

Article ID: 262415

Article Last Modified on 10/15/2002

-

APPLIES TO


 * Microsoft eMbedded Visual Basic 3.0

-



This article was previously published under Q262415



SYMPTOMS
Changing the List property for the selected item in the ComboBox control clears the ComboBox text area. The text area of the ComboBox should change to match the new List property.



RESOLUTION
To work around this problem, you need to store the current ListIndex value before you change the List property for the selected item. Once you have made the change, you need to set the ListIndex to the value that was previously stored. Replace the code for the Command1 Click event in the sample under &quot;Steps to Reproduce Behavior&quot; with the following: Private Sub Command1_Click Dim iTemp As Integer iTemp = Combo1.ListIndex Combo1.List(0) = &quot;Renamed item&quot; Combo1.ListIndex = iTemp End Sub



STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.



Steps to Reproduce Behavior
 Open Microsoft eMbedded Visual Basic 3.0. Create a new Windows CE for the Pocket PC project. Form1 is created by default. Add a ComboBox and a CommandButton control to Form1.  Paste the following code into Form1: Option Explicit

Private Sub Form_OKClick App.End End Sub

Private Sub Form_Load Combo1.AddItem &quot;One&quot; Combo1.AddItem &quot;Two&quot; End Sub

Private Sub Command1_Click Combo1.List(0) = &quot;Renamed item&quot; End Sub  Run the application on either the device or the emulator and select item One in the ComboBox. Click the CommandButton, and note that the ComboBox item text has changed as expected. However, the text area of the ComboBox is cleared and the item is no longer selected.</li></ol>

Additional query words: wce evb vbce

Keywords: kbbug kbpending KB262415

-

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

© Microsoft Corporation. All rights reserved.