XAML的TextBlock设置圆角 [英] Xaml TextBlock set round corner

查看:512
本文介绍了XAML的TextBlock设置圆角的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在 XAML 设置的TextBlock 的圆角。但有没有这样的属性。

I am trying to set rounded corner of TextBlock in xaml. But there is no such property.

<Grid x:Name="grdDis" Grid.Row="1">
        <TextBlock Text="Description" TextWrapping="Wrap" HorizontalAlignment="Left" VerticalAlignment="Top" Name="txtDescription" Margin="18,10,0,0" Height="128" Width="445"/>
</Grid>



我如何设置TextBlock的圆角。并且还需要设置TextBlock的背景颜色。

How can I set rounded corner of TextBlock. And also want to set Background color of TextBlock.

推荐答案

使用的 边框

    <Border Margin="5" Padding="5" BorderThickness="1" BorderBrush="Red" Background="AntiqueWhite" CornerRadius="10">
        <TextBlock Text="Lorem ipsum"/>
    </Border>

这篇关于XAML的TextBlock设置圆角的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆