Changing focus and InputScope on DoubleEditBox

Editors for Universal Windows Forum

Posted 9 years ago by Cody Jordan
Version: 15.1.0161

We are designing a UI where we use a series of DoubleEditBoxes to change parameters and would like to be able to move between them quickly without brining up the onscreen keyboard too much.  

Right now if you have the soft keyboard up then bring up the popout on the DoubleEditBox, the soft keyboard will close because the text portion of the control lost focus.  However when you tap outside of the popup to dismiss it, focus returns to the text and the soft keyboard returns.  We would like it such that when you either dismiss the popup or focus a new control the keyboard doesn't return.

The only way I've thought of to do this is to subscribe an event to the pop up being created (or dismissed) which gives focus to some fictive object which doesn't invoke the soft keyboard.  Is there an event handler or some other way on this control which I could do this?


Smaller question as well, is there a way to change the InputScope to numer on the DoubleEditBox?


Thanks for your time. 

Comments (3)

Posted 9 years ago by Cody Jordan

I have found a way to prevent the soft keyboard from re-appearing after tapping away from (soft dismiss) of the popup.  

If you create a PopupPickerStyle you can specify what kind of control gets used by the popup, in this you can add in an event handler to one of the elements of the popup and subscribe an event to fire when it gets Unloaded.  This event can be used to redirect focus to a control which does not accept keyboard input, so the soft keyboard won't come back up.  In my case I'm using a button with width and height 0 in order to absorb the focus.

Posted 9 years ago by Actipro Software Support - Cleveland, OH, USA

Hi Cody,

The way WinRT popups work is that if you light dismiss them, the focus returns to the previously focused control in the popup owner's visual tree.  WinRT popups don't seem to allow you to tap through to another control immediately while a popup is open.  A second tap is required to focus another control once the popup is dismissed. 

If the control that regains focus upon light dismiss is a text control, the soft keyboard will pop open as needed.  Edit boxes have a TextBox inside their templates and that is what has focus when the edit box gains focus. 

If you set IsEditable = false on an edit box, the TextBox inside its template will be marked read-only and thus the soft keyboard won't show for that edit box, even when it has focus.  The side effect is that text entry won't be available for the edit box while in that mode.  There isn't any way at the moment for you to track when the popup closes other than the manual way you did it.

Another suggestion for this is that you could set the edit box's IsTabStop to true.  Right now it defaults to false, which makes the focus move into the embedded TextBox when it gets focus.  If the edit box's IsTabStop is true, it will be focusable and not pop the soft keyboard when focused, but still will pop the soft keyboard if the embedded TextBox gets focus.

That's a good suggestion for alternate default input scopes on certain edit boxes.  We are changing the numeric, date, and time edit boxes to use Number input scope for the next release.  Also we are exposing a new InputScopeNameValue property on each edit box that will let you customize it further if you like.

Actipro Software Support

Posted 9 years ago by Cody Jordan

Thanks for the feedback, I may have to try the IsTabStop but I think for now attatching events to the template gives us the behavior that we want.

It would also be fairly useful if the various controls had a way to directly assign event handlers to things like OnPopupLoaded or OnPopupDismissed.

Good luck and looking foward to the next version.

The latest build of this product (v22.1 build 0365) was released 7 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.