I'm using the UltrNumericEditor control on a form, but all the text is not selected when I tab into or click into the control. Does anyone know how I can get it to select all of the text when the user tabs into it or clicks into it with them mouse?
Couldn't you just use SelectAll() in the Enter event? I tried that here and it works fine.
I was using the wrong event. I was using the AfterEnterEditMode event which does not get fired when the user clicks into the control with the mouse.
I just testing this out and it works fine for me.
private void ultraNumericEditor1_Enter(object sender, EventArgs e) { this.BeginInvoke(new MethodInvoker(this.ultraNumericEditor1.SelectAll)); }
If it's not working for you, then you should Submit an incident to Infragistics Developer Support and send them a small sample project demonstraing it so they can check it out.
I tried using the BeginInvoke method but that still did not work.
This is probably because the control responds to the mouse and positions the cursor at the point that was clicked. This likely happens after the Enter event fires. So your code to select all the text is probably working, it's just getting overriden by the native behavior of the control.
You can usually get around stuff like this by calling your SelectAll method using a BeginInvoke instead of calling it directly.