xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="242" Width="525">
<Grid>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<StackPanel Margin="25 "Name="stackPanel1" Orientation="Horizontal" >
<Label Content="姓名:" Height="28" Name="lblName"/>
<TextBox Height="23" Name="txtName" Width="120"/><!--普通文本控件-->
</StackPanel>
<StackPanel Grid.Row="1" Margin="25"Orientation="Horizontal">
<Label Content="密码:" Height="28" Name="lblPwd"/>
<PasswordBox Height="23" Name="pwbPwd" Width="120"/><!--密码文本控件-->
</StackPanel>
</Grid>
</Window>
<Window x:Class="Demo_文本控件.TextBox"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="TextBox" Height="300" Width="300">
<StackPanel>
<!--AcceptsReturn:获取或设置一个值,该值指示在多行 TextBox 控件中按Enter 键时,是在控件中创建一行新文本还是激活窗体的默认按钮。-->
<!--AcceptsTab :属性发送反馈获取或设置一个值,指示表达式文本框是否接受 Tab 键-->
<!--AutoWordSelection:获取或设置一个值,该 值决定在用户用鼠标拖过某个单词来选择其中的一部分时,是否选定该单词的其余部分。-->
<!--TextWrapping:获取或设置文本框对文本进行换行的方式。-->
<!--SpellCheck.IsEnabled:获取或设置一个值,该值确定是否对此文本编辑控件(如TextBox 或 RichTextBox)启用拼写检查器。 -->
<TextBox AcceptsReturn="True" AcceptsTab="True" SpellCheck.IsEnabled="True"TextWrapping="Wrap" HorizontalScrollBarVisibility="Auto"HorizontalAlignment="Stretch" />
</StackPanel>

</Window>