gpt4 book ai didi

c# - 管理网格中的列跨度

转载 作者:太空宇宙 更新时间:2023-11-03 20:19:41 25 4
gpt4 key购买 nike

<分区>

Possible Duplicate:
Independants width in a WPF Grid

我想在网格 (2 x 2) 上显示 3 个文本 block

我需要使用 columnspan,但我做不好。

我有什么:

enter image description here

我想要什么:

enter image description here

我尝试了几种操作。

这是我的代码:

<Grid Margin="20" VerticalAlignment="Top" HorizontalAlignment="Stretch">
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>

<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<TextBlock Grid.Row="0" Grid.Column="0" Margin="0,0,10,0" x:Name="TxtBox_cCodeTiers" Text="{Binding m_strCode}" FontWeight="Bold" FontSize="22" />
<TextBlock Grid.Row="0" Grid.Column="1" Margin="0,0,10,0" x:Name="TxtBox_cNomTiers" Text="{Binding m_strNom}" FontWeight="Bold" FontSize="22" />
<TextBlock Grid.Row="1" Grid.Column="0" Margin="0,0,10,0" x:Name="TxtBox_cCPostal" TextWrapping="Wrap" Text="{Binding m_strFonction}" />
</Grid>

我知道我需要使用 ColumnSpan 但我试过了但没有结果:(

任何人都可以

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com