Board index » cppbuilder » TComboBox->ItemIndex not keeping value
William Charles Nickerson
CBuilder Developer |
TComboBox->ItemIndex not keeping value2004-06-25 03:40:43 AM cppbuilder103 Hello I have a TComboBox. I don't want to use AutoComplete as the user needs to be able to enter a new value into the edit. However, if they type an existing item I want it to be selected. In the OnChange handler I check to see if the item is in the list (using Items->IndexOf ()) and if so, I set ItemIndex to the selected index. During debugging I see this happening correctly. The dialog also has an OK button. The code for this checks the ItemIndex property of the TComboBox and finds that it is now -1. If I select the item from the list the value is okay. If I enter the value in the edit box and then popup the pulldown (without actually clicking on an entry), I see the entry selected and the ItemIndex value is fine when I click on OK. What am I missing here? Aloha Bill |