我的滚动查看器有拉伸问题,我在停靠面板内有一个文本框和按钮以及我的滚动查看器,我想要这些项目下方的滚动查看器,但拉伸到停靠面板的宽度和从底部拉伸的高度将面板停靠到按钮和文本框。
所以我尝试了这个:
<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">
然而,滚动查看器不知何故粘在右侧,如下所示: