Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
795
Tabbing into NumericEditor doesn't highlight all the contents
posted

When I tab into a textbox, all the contents are highlighted so immediately typing just overwrites what's there and that's what we want. The same thing does NOT happen with a Numeric Editor. How can I make the numeric editor behave JUST like a textbox.

 1) Tabbing into a textbox pre highlights all the contents

2) Clicking into a textbox does NOT highlight everything and appropriately sets the cursor caret.

Parents
  • 2077
    Verified Answer
    Offline posted

    You can subscribe to the Enter or BeforeEnterEditMode events in the NumericEditor, and in the event handler method call the SelectAll() method on the control:

    OnLoad()
    {
        UltraNumericEditor numericEditor;
        numericEditor.BeforeEnterEditMode += OnNumericEditorBeforeEnterEditMode;
    }

    private void OnNumericEditorBeforeEnterEditMode(object sender, CancelEventArgs args)
    {
        UltraNumericEditor tempNumEdit = sender as UltraNumericEditor;
        if(tempNumEdit != null)
        {
            tempNumEdit.SelectAll();
        }
    }

    It should work as you want.

    Hope it helps,

    Emanuel

Reply Children