【问题标题】:Floating Panel (overlapping with align)浮动面板(与对齐重叠)
【发布时间】:2012-06-16 14:19:59
【问题描述】:

是否有可能在 wpf 的面板中浮动(与对齐重叠)子项。 我有 4 个相互重叠的按钮。它们需要左右对齐,上下对齐,并与父容器一起增长。请查看图片了解更多信息。

【问题讨论】:

    标签: c# wpf


    【解决方案1】:

    这个怎么样?

    <Grid>
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="1*"/>
                <RowDefinition Height="2*"/>
                <RowDefinition Height="1*"/>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition/>
                <ColumnDefinition/>
            </Grid.ColumnDefinitions>
    
            <Button Grid.Row="1" Grid.Column="0" Content="Left"/>
            <Button Grid.Row="1" Grid.Column="1" Content="Right"/>
        </Grid>
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition/>
                <RowDefinition />
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="1*"/>
                <ColumnDefinition Width="2*"/>
                <ColumnDefinition Width="1*"/>
            </Grid.ColumnDefinitions>
    
            <Button Grid.Row="0" Grid.Column="1" Content="Top"/>
            <Button Grid.Row="1" Grid.Column="1" Content="Bottom"/>
        </Grid>
    </Grid>
    

    导致

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-01-18
      • 1970-01-01
      • 2017-03-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多