Hello,
I have a UltraCombo with the property LimitToList set to true, but when some is tryprd that doesn't exist in the combo box the focus will not go outside of the combo box until a value is selected that exists in the combo. What I need is the ability enable a button when something is typed that doesn't exist in the combo and allow the user to be able to click that button without having to make a valid selection in the combo box. I don't want to lose the LimitToList funtionality because they like to be able to type to see if the value exists in the combo box.
Thanks in advance for any help.
Kris
Hi Mike,
I'm having the same problem as Kris, and I have gotten to the same stage as him, where do I find these properties frim the UltraCombo class? I would like the behavior to appear to ignore the last key stroke if it is invalid, and keep the old selection.
Hi Kris,
The highlighting of the text is controlled by the SelectionStart and SelectionLength properties. Were you not aware of these two properties? O are you saying that they don't work inside KeyUp?
Here is what I did. I couldn't get exactly what I wanted but I can live with what I got.
I set the LimitToList property to true and in the ItemNotInList event of my control I set the e.RetainFocus = false and I disable the button that I don't want the user to click if there hasn't been a valid selection in the combo.
Here is what I really wanted. Say my combo has these three entries: [Smith, Kris] [Smith, Jake] [Parker, Mike] I have the LimitToList set to true. I start typing:
Sm displays Smith, Kris
Smo displays Smith, Kris
The o key stroke is cancelled and the item doesn't change but stays on the last valid selection. I tried using the KeyDown and KeyUp events and I could get close but not exactly. One of the problems I was having I could get the last valid entry in the KeyDown but in the KeyUp I could only set the text value to the complete text with no highlighting so when I would start to type again it would be at the very end of the valid string.
If my above example gives you a better understanding of what I am trying to accomplish and you have a way to create this type of behavior I would love to know how.
Thanks for all your help.
You can only stop a key from reaching the control using the KeyDown or maybe KeyPress events. You could trap one of these events and then use the IsItemInList method to check for the existance of an item on the list yourself, without using LimitToList. That's another option.
HI Mike,
I can use this event to accomplish what I want. I did try setting the DropDownStyle to DropDownList and setting AutoEdit to true but that didn't give me the type ahead functinality that I want. It is still just going to the first letter of value in the list.
BTW, is there a way to kill the last key stock received in this event? So it would stop the type ahead until it found the next set of matching data.
Thanks,