0

TextBlockの高さを親コントロールの高さにバインドするにはどうすればよいですか?

私はグリッドの中にあり、値をハードコーディングせずに&をグリッドセルの高さと幅にしTextBlockたいです。TextBlock HeightWidth

乾杯

AWC

4

4 に答える 4

2

Viewboxは最も簡単な方法です:

<Page
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
  <Grid>  
  <Viewbox>
   <TextBlock Text="Hello World"/>
   </Viewbox>
  </Grid>
</Page>

お役に立てれば、

乾杯、アンバカ

于 2010-02-18T14:25:22.403 に答える
0

これがあなたが探しているものです:

<Grid >
 <Grid.RowDefinitions>
    <RowDefinition Height="*" />
 </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
  <TextBlock x:Name="SelectedUserName" Grid.Row="0" Grid.Column="0" ></TextBlock>
 </Grid>
于 2010-02-18T14:36:17.620 に答える
0

テキストボックスがグリッド内にある場合、グリッド セルの測定値から測定値を取得します。

于 2010-02-18T14:24:38.077 に答える
0

試着しましたかTextBlock:

VerticalAlignment="Stretch" HorizontalAlignment="Stretch"

これはデフォルトです!

于 2010-02-18T14:25:26.810 に答える