wpf文本块与px确切的上边距

时间:2018-01-08 06:22:19

标签: c# wpf margin textblock

<TextBlock x:Name="ctTbMain" Text="INITIALIZING THE SYSTEM NEW UI"     Canvas.Left="0" Canvas.Top="190px" Width="{Binding Path=ActualWidth, ElementName=ctPagebody}" Style="{StaticResource styleTextInit1}" />

让我们说我想从上边距设置这个TextBox精确的290px 我该怎么做?

1 个答案:

答案 0 :(得分:0)

如果您想拥有290px的保证金,只需设置保证金。

<TextBlock 
  x:Name="ctTbMain" 
  Text="INITIALIZING THE SYSTEM NEW UI" 
  Margin="0,290,0,0" 
  Width="{Binding Path=ActualWidth, ElementName=ctPagebody}" 
  Style="{StaticResource styleTextInit1}"
/>