Actually, the selection is working.
You may feel that the text is not selected because it's not visually highlighted, but that's because the TextBox
is not focused.
Try giving focus to your TextBox
with the Tab
key, you'll see the whole text highlighted.