开发者

Make text to have background + border

开发者 https://www.devze.com 2023-03-10 08:25 出处:网络
If I have a label with its content \"White, Yellow, Black\" and I want to make \"yello开发者_JAVA技巧w\" to have a white background color + border with black line around the word \"Yellow\".

If I have a label with its content "White, Yellow, Black" and I want to make "yello开发者_JAVA技巧w" to have a white background color + border with black line around the word "Yellow".

What XAML code is needed?


You need to split the content:

<Label>
    <StackPanel Orientation="Horizontal">
        <TextBlock Text="White, "/>
        <Border BorderBrush="Black" BorderThickness="1">
            <TextBlock Background="White" Text="Yellow"/>
        </Border>
        <TextBlock Text=", Black"/>
    </StackPanel>
</Label>

(If this is not what you want you should express yourself more clearly)

0

精彩评论

暂无评论...
验证码 换一张
取 消