スクロール ビューアにストレッチの問題があります。スクロール ビューアと一緒にドック パネル内にテキストボックスとボタンがあります。これらのアイテムの下にスクロール ビューアが必要でしたが、ドック パネルの幅と高さが下部から伸びていました。ボタンとテキストボックスまでパネルをドッキングします。
だから私はこれを試しました:
<UserControl x:Class="WpfApplication4.AppPages.FindStudent"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300" Loaded="UserControl_Loaded">
<DockPanel Height="299" Width="289">
<TextBox Height="23" Name="textBox1" Width="188" VerticalAlignment="Top"/>
<Button Content="Button" Height="23" Name="button1" Width="100" Click="button1_Click" VerticalAlignment="Top" />
<ScrollViewer VerticalScrollBarVisibility="Hidden" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Width="88">
ただし、スクロール ビューアーは次のように右側に固定されています。