繁体   English   中英

在XAML中自动调整控件的大小以适合堆栈面板/停靠面板,其中中间控件是需要填充空间的地方

[英]Autosizing controls in XAML to fit a stack panel / dock panel, where the middle control is what needs to fill the space

我该如何创建...

命令http://img841.imageshack.us/img841/2631/46lc.jpg

在WPF中。

我已经阅读了很多有关使用堆栈面板与停靠面板的其他问题,但似乎无法重新创建所需的内容。 这是我目前拥有的..

command2 http://img13.imageshack.us/img13/5374/7oft.jpg

和我的xaml ..

<DockPanel VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Background="DarkGray" Grid.ColumnSpan="2" Grid.Row="1" LastChildFill="False" >
            <TextBlock Text="{StaticResource commandText}" Style="{StaticResource Heading2}" Margin="0,0,0,0" VerticalAlignment="Center" DockPanel.Dock="Left" />
            <TextBox Name="inputTextBox" VerticalAlignment="Center" HorizontalAlignment="Stretch" />
            <Button x:Name="termSend" Content="{StaticResource sendText}" Margin="0,0,0,8" DockPanel.Dock="Right" VerticalAlignment="Center" />
        </DockPanel>
<DockPanel>
   <TextBlock VerticalAlignment="Center" Text="Command" DockPanel.Dock="Left"/>
   <Button Content="Send" VerticalAlignment="Center" DockPanel.Dock="Right"/>
   <TextBox VerticalAlignment="Center" Margin="5"/>
</DockPanel>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM