Select All on GotFocus Int32 / Double Editbox

Editors for WPF Forum

Posted 7 years ago by Wilfried Goller
Version: 11.1.0545

i want to select all content of an Int32EditBox / DoubleEditBox when the control GotFocus- Event occurs.
my prolem is that i cant set the selected text.

are there any solutions for this problem?


Comments (1)

Posted 7 years ago by Actipro Software Support - Cleveland, OH, USA
Hi Wilfried,

The default behavior is to selected all the text when you use the keyboard to tab into the control's text. If you are using the mouse, then it won't select all the text if you click on the text. Instead it will allow the user to click and drag to select a portion of the text. Clicking anywhere in the empty space will select all the text as well.

So I'm assuming you are referring to selecting all the text when clicking on the text. Is that correct?

You can use the PartEditBox.SelectFirstGroup method to select the first part group (which by default contains the text you see). Alternatively, you can attached handler for the MouseLeftButtonDown event and look for MaskedTextBox in the e.OriginalSource property. Then call it's SelectAll method.

Actipro Software Support

The latest build of this product (v2018.1 build 0675) was released 14 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.