<Window x:Class="TextBoxSample.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="选取TextBox文字范例" Height="375" Width="525">
    <Grid>
        <TextBox Height="27" HorizontalAlignment="Left" Margin="34,30,0,0" Name="txtMessage" VerticalAlignment="Top" Width="439" Text="我喜歡用C#開發WPF應用程式 !!" FontSize="14" />
        <Button Content="1. 打印选取的文字" Height="23" HorizontalAlignment="Left" Margin="34,79,0,0" Name="button1" VerticalAlignment="Top" Width="153" Click="button1_Click" FontSize="14" />
        <TextBox Height="27" HorizontalAlignment="Left" Margin="34,108,0,0" Name="txtMessage1" VerticalAlignment="Top" Width="423" FontSize="14" />
        <Button Content="2. 用程序选取所有文字" Height="23" HorizontalAlignment="Left" Margin="34,156,0,0" Name="button2" VerticalAlignment="Top" Width="153" Click="button2_Click" FontSize="14" />
        <TextBox Height="27" HorizontalAlignment="Left" Margin="34,185,0,0" Name="txtMessage2" VerticalAlignment="Top" Width="423" FontSize="14" />
        <Button Content="3. 用程序选取前十个字符" Height="23" HorizontalAlignment="Left" Margin="34,237,0,0" Name="button3" VerticalAlignment="Top" Width="188" Click="button3_Click" FontSize="14" />
        <TextBox Height="27" HorizontalAlignment="Left" Margin="34,266,0,0" Name="txtMessage3" VerticalAlignment="Top" Width="423" FontSize="14" />
    </Grid>
</Window>
