XAML <TextBlock> element represents a TextBlock control.
- <TextBlock Name="TextBlock1" Height="30" Width="200"
- Text="Hello! I am a TextBlock." Foreground="Red">
- </TextBlock>
- <TextBlock Name="TextBlock1" Height="30" Width="200"
- Text="Hello! I am a TextBlock."
- Margin="10,10,0,0" VerticalAlignment="Top"
- HorizontalAlignment="Left">
- </TextBlock>
The following code example sets TextBlock's font including font name, font size, and font styles.
- FontSize="14" FontFamily="Verdana" FontWeight="Bold"
- TextWrapping="Wrap"
- TextAlignment="Right"
- <TextBlock Name="TextBlock1" Height="30" Width="200"
- Text="Hello! I am a TextBlock." Foreground="Red"
- Margin="10,10,0,0" VerticalAlignment="Top"
- HorizontalAlignment="Left"
- FontSize="14" FontFamily="Verdana" FontWeight="Bold"
- TextWrapping="Wrap" TextAlignment="Center" Padding="2">
- </TextBlock>

Vithal WadjePosted Jan 10, 2015, 1:57 PM
nice,thanks for sharing