Export (0) Print
Expand All
1 out of 3 rated this helpful - Rate this topic

How to: Set Focus in a TextBox Control

This example shows how to use the Focus method to set focus on a TextBox control.

Example

The following Extensible Application Markup Language (XAML) example describes a simple TextBox control named tbFocusMe

<TextBox Name="tbFocusMe">
  This is the text in my text box.
</TextBox>

The following example calls the Focus method to set the focus on the TextBox control with the Name tbFocusMe.

tbFocusMe.Focus();

See Also

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.