BUG: eVB: Changing the List Property Clears ComboBox Text Area (262415)



The information in this article 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 "Steps to Reproduce Behavior" with the following:
Private Sub Command1_Click()
    Dim iTemp As Integer
    
    iTemp = Combo1.ListIndex
    Combo1.List(0) = "Renamed item"
    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.

MORE INFORMATION

Steps to Reproduce Behavior

  1. Open Microsoft eMbedded Visual Basic 3.0.
  2. Create a new Windows CE for the Pocket PC project. Form1 is created by default.
  3. Add a ComboBox and a CommandButton control to Form1.
  4. Paste the following code into Form1:
    Option Explicit
    
    Private Sub Form_OKClick()    
        App.End    
    End Sub
    
    Private Sub Form_Load()    
        Combo1.AddItem "One"
        Combo1.AddItem "Two"   
    End Sub
    
    Private Sub Command1_Click()
        Combo1.List(0) = "Renamed item"    
    End Sub
    					
  5. Run the application on either the device or the emulator and select item One in the ComboBox.
  6. 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.

Modification Type:MajorLast Reviewed:10/15/2002
Keywords:kbBug kbDSupport KB262415