我有一个伸展问题,我的滚动查看器,我有一个文本框和一个停靠面板内的按钮以及我的scrollviewer,我希望这些项目下面的滚动查看器,但拉伸到停靠面板的宽度和高度从底部拉伸坞面板上的按钮和文本框。滚动查看器卡在Dockpanel的右侧?
所以我tryed这一点:
<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">
然而滚动浏览器以某种方式粘在右手边,像这样:
在DockPanel上,如果您不想让最后一个控件伸展以填充剩余空间,您可以设置LastChildFill =“False”。 – 2012-04-18 15:31:14
嗨周杰伦那工作,谢谢。 – 2012-04-18 16:13:44