如何在 Windows Phone 8 的 TextBox/TextBlock 控件中添加一些文本? [英] How to Superscript some Text in a TextBox/TextBlock Control in windows phone 8?

查看:34
本文介绍了如何在 Windows Phone 8 的 TextBox/TextBlock 控件中添加一些文本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发 Windows Phone 8 应用程序,但我被困在这里,伙计们,我想尽可能在​​ TextBox 或 TextBlock 中显示一些文本作为上标.建议我如何获得它.谢谢

I'm working on windows phone 8 app, and m stuck here, guys i want to show some text as a superscript either in TextBox or in TextBlock where-ever possible. suggest me how can i obtained it. Thanks

推荐答案

为什么不使用封装几个文本块的堆栈面板?然后调整您想要上标和下标的内容的边距.

Why don't you use a stackpanel wrapping a couple of textblocks instead? Then adjust the margines on the stuff you want super and subscripted.

        <StackPanel Orientation="Vertical">
        <TextBlock Text="H2O3" FontSize="40" Margin="0,10"/>
        <StackPanel Orientation="Horizontal">
            <TextBlock Text="H" FontSize="40" />
            <TextBlock Text="2" FontSize="40" Margin="0,-20,0,0"/>
            <TextBlock Text="O" FontSize="40"/>
            <TextBlock Text="3" FontSize="40" Margin="0,10,0,-10"/>
        </StackPanel>
    </StackPanel>

这篇关于如何在 Windows Phone 8 的 TextBox/TextBlock 控件中添加一些文本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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