Skip to content

Latest commit

 

History

History
41 lines (28 loc) · 1.59 KB

AutoSelectBehavior.md

File metadata and controls

41 lines (28 loc) · 1.59 KB
title author description keywords dev_langs
AutoSelect Behavior
jbrianceau
Behavior to automatically select the entire content of a TextBox control when it loads.
windows 10, uwp, windows community toolkit, uwp community toolkit, uwp toolkit, textbox, behaviors, interactivity, selection
csharp

AutoSelect Behavior

The AutoSelectBehavior automatically selects the entire content of its associated TextBox when it is loaded.

Platform APIs: AutoSelectBehavior

[!div class="nextstepaction"] Try it in the sample app

Example

In this example using the AutoSelectBehavior the textbox content will be automatically selected when it is loaded:

  <TextBox Text="My content is selected when loaded">
    <interactivity:Interaction.Behaviors>
      <behaviors:AutoSelectBehavior />
    </interactivity:Interaction.Behaviors>
  </TextBox>

Sample Project

AutoSelect behavior sample page Source. You can see this in action in Windows Community Toolkit Sample App.

Source Code

Related Topics