SuperScript和SubScript在richtextbox中无法正常工作 [英] SuperScript and SubScript is not working properly in richtextbox

查看:85
本文介绍了SuperScript和SubScript在richtextbox中无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用richtextbox创建了richtextbox编辑器。 SuperScript和下标是功能的一部分。

I have created richtextbox editor using richtextbox. SuperScript and subscript is a part of functionality.

但如果我在richtextbox上为所选内容选择并提供SuperScript或下标,则内容已被替换为下标操作,反之亦然。 

But if i select and give SuperScript or subscript for selected content on the richtextbox, Content has been superscripted for subscript operation and vice versa. 

我使用的逻辑,

TextRange tr = new TextRange(richTextBox.Document.ContentEnd,richTextBox.Document.ContentEnd);

TextRange tr = new TextRange(richTextBox.Document.ContentEnd, richTextBox.Document.ContentEnd);

tr.ApplyPropertyValue(Inline.BaselineAlignmentProperty,BaselineAlignment.Subscript);

tr.ApplyPropertyValue(Inline.BaselineAlignmentProperty, BaselineAlignment.Subscript);

请提供帮助

推荐答案

您好,

 我不是熟悉WPF项目。但是,以下链接

 I am not familiar with WPF projects. However, the following link

应指导您找到合适的解决方案;

should guide you to a proper solution;

 

  https://docs.microsoft.com/en-us/dotnet/api/system.windows.baselinealignment?view=netframework-4.8

 https://docs.microsoft.com/en-us/dotnet/api/system.windows.baselinealignment?view=netframework-4.8

 希望这会有所帮助:)

 Hope this helps :)


这篇关于SuperScript和SubScript在richtextbox中无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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