Select All on GotFocus Int32 / Double Editbox

Editors for WPF Forum

Posted 12 years ago by Wilfried Goller
Version: 11.1.0545
Avatar
Hi,

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?

Thanks

Comments (1)

Posted 12 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
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 (v24.1.1) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.