Web应用程序中RichTextBox中的Silverlight 4上标
在WPF上标是:
var currentAlignment = richTextBox.Selection.GetPropertyValue(Inline.BaselineAlignmentProperty);
BaselineAlignment newAlignment = ((BaselineAlignment)currentAlignment == BaselineAlignment.Superscript) ? BaselineAlignment.Baseline : BaselineAlignment.Superscript;
richTextBox.Selection.ApplyPropertyValue(Inline.BaselineAlignmentProperty, newAlignment);
richTextBox.Selection.ApplyPropertyValue(Inline.FontSizeProperty, (double)8);
但是如何在Web应用程序中实现Inline.BaselineAlignmentProperty?
in WPF superscript is:
var currentAlignment = richTextBox.Selection.GetPropertyValue(Inline.BaselineAlignmentProperty);
BaselineAlignment newAlignment = ((BaselineAlignment)currentAlignment == BaselineAlignment.Superscript) ? BaselineAlignment.Baseline : BaselineAlignment.Superscript;
richTextBox.Selection.ApplyPropertyValue(Inline.BaselineAlignmentProperty, newAlignment);
richTextBox.Selection.ApplyPropertyValue(Inline.FontSizeProperty, (double)8);
But how to implement Inline.BaselineAlignmentProperty in Web Application ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Silverlight 不支持 BaseLineAlignment,但是您可以使用 Unicode 实现上标,只需将以下内容放入代码隐藏中即可实现目的。
Silverlight does not support BaseLineAlignment, however you could achieve superscript by using Unicode, just put the following in your code-behind and it will do the trick.