<StackPanel x:Name="LayoutRoot" Background="White">
<TextBlock Margin="20,20,0,0" Text="Type Text Here"/>
<TextBox x:Name="ReadWriteTB" TextChanged="ReadWriteTB_TextChanged" IsReadOnly="False" HorizontalAlignment="Left" Margin="20,5,0,0" Height="35" Width="200" />
<TextBlock Margin="20,20,0,0" Text="Read Only TextBox"/>
<TextBox x:Name="ReadOnlyTB" IsReadOnly="True" HorizontalAlignment="Left" Margin="20,5,0,0" Height="35" Width="200" />
<TextBlock Margin="20,30,0,0" Text="Search Type TextBox" />
<TextBlock Margin="20,0,0,0" FontSize="11">
The following text box has a watermark text (Search). The text is gray until you click inside the text box.
<LineBreak />
When you click inside the text box the watermark text is removed and the cursor appears ready for input.
</TextBlock>
<TextBox x:Name="SearchTB" Margin="20,5,0,0" Text="Search" HorizontalAlignment="Left" Height="35" Width="200" Foreground="Gray" GotFocus="SearchTB_GotFocus" LostFocus="SearchTB_LostFocus" />
<TextBlock Margin="20,40,0,0" Text="Demonstrating styles for TextBox" />
<TextBlock Margin="20,0,0,0" FontSize="11">
Select the following text to view the results of SelectionForeground and SelectionBackground properties.
</TextBlock>
<TextBox Text="Styles" Margin="20,5,0,0" HorizontalAlignment="Left" Width="200" Height="35" FontFamily="Arial" FontSize="15" Foreground="White" Background="Black" BorderBrush="White" SelectionForeground="Black">
<TextBox.SelectionBackground>
<LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
<GradientStop Color="Gray" Offset="0.0" />
<GradientStop Color="White" Offset="1.0" />
</LinearGradientBrush>
</TextBox.SelectionBackground>
</TextBox>
</StackPanel>