views:

158

answers:

1

I have a textbox which has a very long url inside of it. What I would like to do is, when the user hits the home button I would like the cursor to go to the beginning of the textbox.

I would expect this to be the normal behavior but its not, when the text inside of the textbox is very long, and I hit home, it goes to the beginning of that portion of the text which is currently visible in the textbox, not all of it.

Any ideas ?

+2  A: 

My guess is you've got TextWrapping set to Wrap. Set this to NoWrap (or remove the attribute from the Xaml) and then you will see normal behaviour.

You'll have the TextBox probably place in some kind of Grid which limits the height of the TextBox to a typical single line height. However with Wrapping turned on the content will actually be wrapped on to multiple lines. Using Home and End keys in this scenario will only take you to the beginning and end of a line.

If you expand the height of the location where the TextBox is placed you will see multiple lines.

AnthonyWJones