簡體   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