RichTextBox控件令人头疼

RichTextBox控件令人头疼

本文介绍了RichTextBox控件令人头疼的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时删除!!

大家好,

我只是在谷歌搜索和研究时碰壁,所以我来找你:)

我做了一个看起来像富文本编辑器的控件.我所做的是,我只是在用户控件中放置了一个扩展的RichTextBox,并添加了一些按钮.它像一种魅力.现在,这样做是为了支持向我们的客户数据添加描述.转到DevEx报表时,该描述会被提取.在我的DevEx报告中,我还具有RichTextBox控件(当然是报告控件:)).就是介绍了!

当客户端开始在控件中切换时会发生问题.您会看到,他想在左边排队,例如说文章,然后在右边跳出标签并写下价格.他在我的控制下做到了,但是一旦到达DevEx,制表符就会变得混乱不堪,最终我得到的文字没有对齐.当我将文本复制/粘贴到单词时也会发生这种情况.

我联系了DevEx团队,他们说这是设计使然! DevEx控件和Word显然使用GDI +编写和测量字符串,而RichTextBox使用GDI!

就是这些令人毛骨悚然的加号"弄乱了我的工作.

你能帮我吗!?您有什么建议吗?

我想要实现的是:当我查看选项卡和制表位时,我希望我在richTextBox中编写的文本在Word中是相同的!字体,大小,颜色不是问题.是导致头痛的标签!

请大家帮忙!

问候,

Hi guys,

I just hit the wall with googling and researching so I come to you :)

I made a control that should look like rich text editor. What I did is, I just placed an extended RichTextBox in my user control and added some buttons. It works like a charm. Now this was made to support adding a description to our clients data. That description gets pulled when going to DevEx report. On my DevEx report I also have RichTextBox control(report control of course :) ). That''s it for the intro!

Problems happen when the client starts to tab off in the control. You see, he wants to line up, lets say, articles on the left and than tab off to the right and write prices. And he does that in my control, but as soon as it gets to DevEx tab stops get mixed up and I end up with not-lined-up text. This also happens when I copy/paste the text to word.

I contacted DevEx team and they say it''s by design! DevEx control and Word, apparently use GDI+ to write and mesaure strings and RichTextBox uses GDI!

It''s this darn "plus" that is messing my work.

Can you help!? Do you have any suggestions?

What I want to achieve is: I want the text I wrote in richTextBox to be the same in Word when I look at the tabs and tab stops! Font, size, color is not the problem. It''s tabs that cause the headache!

Please help guys!

Regards,

推荐答案


这篇关于RichTextBox控件令人头疼的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

1403页,肝出来的..

09-06 09:57