Hi
I'm using an UltraCombo with a BindingList bound to it.
I'd like to implement my own AutoCompletion feature. Therefore I've set the AutoCompleteMode to None, on KeyDown, the Combo is dropped down explicitly having the appropriate column filters set.
This works fine, but when the combo is dropped down, the so far entered text in the textbox is completely selected. It would be nicer if the caret would maintain its position, so that the user is can continue typing without overwriting the text portion he already entered.
I've already tried to override this behaviour by clearing the text selection and setting the caret to the end in the AfterDropDown event. But this does not help.
Is there another way to do this?
Thanks in advance!
This is probably just an issue of timing. Try this:
private void ultraCombo1_AfterDropDown(object sender, EventArgs e) { this.BeginInvoke(new MethodInvoker(this.SetSelection)); } private void SetSelection() { this.ultraCombo1.Textbox.SelectionLength = 0; this.ultraCombo1.Textbox.SelectionStart = this.ultraCombo1.Textbox.Text.Length; }
Hello,
In the example posted above, why not just call the SetSelection method directly instead of through the MethodInvoker call?
Hi Mike
thanks a lot for your help! we would invite you for a beer if you were living a bit closer to us :-)
greetings from Switzerland, olivier