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

查看:73
本文介绍了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天全站免登陆