I am using the UltraComboEditor. When it is dropped down (either DroppedDown = true or DropDown()) it selects the text in the editor.
Is there a way I can disable this, I do not want the text selected when the control is dropped down?
This workaround did not worked for me. Also, even if it had worked, why the text is selected after a dropdown when having the AutoCompleteMode property set to None?
Can you please publish the source code with your working workaround because I tried it with a sample project and was not able to make it work.
Another workaround that will do the job for me will be that when the dropdown is displayed and the entire text is selected, if I click the "end" keyboard key, I would like to have the cursor moved to the end of the entered text, with no text selected, instead of having the drowdown scrolled until the end of the list. Is this possible?
Thanks in advance
Hello mgasystems2003,
I have tried the AfterDropDown event of the UltraComboEditor and it does work for me. What you could do is something like the following:
ultraComboEditor1.AfterDropDown += new EventHandler(ultraComboEditor1_AfterDropDown); void ultraComboEditor1_AfterDropDown(object sender, EventArgs e) { UltraComboEditor edi = sender as UltraComboEditor; edi.SelectionStart = 0; edi.SelectionLength = 0; }
ultraComboEditor1.AfterDropDown += new EventHandler(ultraComboEditor1_AfterDropDown);
void ultraComboEditor1_AfterDropDown(object sender, EventArgs e) { UltraComboEditor edi = sender as UltraComboEditor; edi.SelectionStart = 0; edi.SelectionLength = 0; }
Please let me know if you need any other assistance with this matter.
Hi,
No, there's no way to turn this off. This is how all ComboBox controls behave.
You might be able to use an event of the combo and set the SelectionStart/SelectionLength property to de-select the text. But I suspect it will be tough to find an event in which this works. Look for an event like Before/AfterDropDown.
If those don't work, then you might try using a BeginInvoke inside one of those events so that the code gets executed a little bit later.