>I've been having difficulty persuading Visual FoxPro comboboxes to behave rationally. I have a KeyPress event looking for ENTER to execute some code to populate the drop down. I also have an Interactive Change and/or a Click event to tell me when a selection from the dropdown is made.
>
>Problem is, the KeyPress event works fine, but if I use Interactive Change or Click event I can never tell when an ENTER is done with the list dropped down or not. If is is hit when the drop down is on, I want to select the value entered on, other wise I want to us the display value.
>
>Bizzarely enough using a the ListIndex often returns greater than zero when new values are being entered, when I had assumed it would be set to zero when you started tying characters not seen in the drop down.
>
>What is the standard method of handling combobox entry?
Grant
This is most likely way off base but I figured I would mention it anyway.
In the KeyPress (as in other areas) using the key word NODEFAULT keeps VFP from going any higher up the ladder & firing code -- especially VFP base code. You 'may' look at using NODEFAULT with your 'ENTER' to better control what fires when the ENTER is used.
HTH
Tom