AutoSelect Behavior
The AutoSelectBehavior
automatically selects the entire content of its associated TextBox when it is loaded.
Platform APIs:
AutoSelectBehavior
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
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for