or
<
Window
x:Class
=
"FocusOnTextBox6.MainWindow"
xmlns:telerik
=
"http://schemas.telerik.com/2008/xaml/presentation"
Title
=
"MainWindow"
Height
=
"350"
Width
=
"525"
>
<
Grid
>
<
Grid.Resources
>
<
Style
x:Key
=
"UpperCodes6Mask"
TargetType
=
"telerik:RadMaskedTextInput"
>
<
Setter
Property
=
"FontFamily"
Value
=
"Segoe UI"
/>
<
Setter
Property
=
"Margin"
Value
=
"0 0 0 0"
/>
<
Setter
Property
=
"Width"
Value
=
"60"
/>
<
Setter
Property
=
"Height"
Value
=
"20"
/>
<
Setter
Property
=
"Padding"
Value
=
"0"
/>
<
Setter
Property
=
"Placeholder"
Value
=
" "
/>
<
Setter
Property
=
"IsClearButtonVisible"
Value
=
"False"
/>
<
Setter
Property
=
"TextMode"
Value
=
"PlainText"
/>
<
Setter
Property
=
"SectionsNavigationMode"
Value
=
"None"
/>
<
Setter
Property
=
"IsLastPositionEditable"
Value
=
"False"
/>
<
Setter
Property
=
"InputBehavior"
Value
=
"Insert"
/>
<
Setter
Property
=
"SelectionOnFocus"
Value
=
"SelectAll"
/>
<
Setter
Property
=
"Mask"
Value=">a6" />
</
Style
>
</
Grid.Resources
>
<
StackPanel
Orientation
=
"Horizontal"
>
<
telerik:RadMaskedTextInput
Margin
=
"3 0 0 0"
Height
=
"20"
Padding
=
"0"
Style
=
"{StaticResource UpperCodes6Mask}"
Name
=
"tbClid"
/>
<
TextBox
Name
=
"tbTest"
Margin
=
"10 0 0 0"
Height
=
"25"
Width
=
"50"
/>
<
Button
Name
=
"btnTest"
Margin
=
"20 0 0 0"
Content
=
"Test Focus"
Height
=
"25"
Width
=
"100"
Click
=
"btnTest_Click"
/>
<
Button
Name
=
"btnTestRegular"
Margin
=
"20 0 0 0"
Content
=
"Test Focus TextBox"
Height
=
"25"
Width
=
"100"
Click
=
"btnTestRegular_Click"
/>
</
StackPanel
>
</
Grid
>
</
Window
>
namespace
FocusOnTextBox6
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public
partial
class
MainWindow : Window
{
public
MainWindow()
{
InitializeComponent();
}
private
void
btnTest_Click(
object
sender, RoutedEventArgs e)
{
tbClid.Value =
"8888"
;
tbClid.Focus();
}
private
void
btnTestRegular_Click(
object
sender, RoutedEventArgs e)
{
tbTest.Text =
"9999"
;
tbTest.Focus();
tbTest.SelectAll();
}
}
}