Prevent index change in list box on keypress
Hello Everyone,
I'm having a problem with my listbox control. I am trying to handle all the keypress events for the listbox and changing the index to the item I want as they type. But the problem is the listbox changes the index to the last key they hit.
Here is what's going on.
listbox items example
Car
Cop
Man
Open
I type C and Car is selected. I continue typing O and I programatically select the Cop but after I do that VB takes over somehow and selects Open. I need to stop this. how can I disable VB changing the listbox to the last key pressed?
Thanks for all your assistance.
Mythos.
Re: Prevent index change in list box on keypress
Well I found a way around it by setting a variable to the index I changed to and on selectedindexchange I check to see if the selected index matches my variable and if it doesn't then i set it to my index again.
If there is a better way than this please let me know
thanks again
Mythos