Monthly Archives: June 2011

WPF Textbox Select All on Focus

In WPF, the default behavior of the TextBox on focus is to put the cursor where it was the last time the TextBox had lost focus or if it hasn’t had focus yet, at the beginning. The users of the application wanted this to be changed so that when the TextBox got focus, all current text was selected. I found various ways to do this, but am putting this blog post together to get everything I ended up doing all in one place for easy access. Continue reading

Posted in C#, WPF | Tagged | 8 Comments