精通
英语
和
开源
,
擅长
开发
与
培训
,
胸怀四海
第一信赖
Hello there,你好,
I am a big fan of this control this will help me a lot in my project. 我喜欢这种控件,这将在我的项目中帮助我很多。
I have a silly question I might already know the answer but just to make sure that I have the correct answer, what about Tables is there any way to be added to the control??? 我有一个简单的问题,我可能已经知道答案只是我不太确定,有什么方法可以将表添加到控件? ? ?
Hello. 你好。
About your question... Well, this is one of the biggest limitations this control (RichTextBox is just a wrapper around RichEdit) has. This is not because I missed something, but because it was initialy designed as it it is now. You may refer to the MSDN documentation and get a little more info about sutiation yor are in and try to solve it. 关于你的问题…那么,这是这个控件最大的限制之一(RichTextBox只是RichEdit中的包装)的,这并不是因为我丢失一些东西,而是因为它是最初的设计就是现在的样式。你可以参考MSDN文档并获得更多的信息,然后试图解决它。
The only way I can see in this situation is parsing RTF yourself and building internal table representation for later use. But it far from perfect. At least you may try this one . 在这种情况下我能看到的唯一方法就是自己解析RTF和建筑内部表,供以后使用。但这远非完美,至少你可以试试这个。
Hope info about helped you. If you will have any questions or ideas, don't hesitate to contact me. 希望信息能够帮助你,如果你有任何问题或想法,不要犹豫,请与我联系。
Thanks a lot man , thats what I was expecting. 谢谢,这是我所期待的。
I am working on that by editing the Rtf code 我正在通过编辑Rtf代码工作。
I don't know if you have better idea for this, inserting Rtf code into RichTextBox by using the following code:
我不知道对不对,如果你有更好的主意告诉我,我通过使用下面的代码插入Rtf代码到RichTextBox:
richTextBox1.SelectedText = "hehehe";
String table = @"\trowd\trgaph108\trleft-108\trbrdrl\brdrs\brdrw10 \trbrdrt\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trbrdrb\brdrs\brdrw10 \trpaddl108\trpaddr108\trpaddfl3\trpaddfr3\clbrdrl\brdrw10\brdrs\clbrdrt\brdrw10\brdrs\clbrdrr\brdrw10\brdrs\clbrdrb\brdrw10\brdrs \cellx2844\clbrdrl\brdrw10\brdrs\clbrdrt\brdrw10\brdrs\clbrdrr\brdrw10\brdrs\clbrdrb\brdrw10\brdrs \cellx5796\clbrdrl\brdrw10\brdrs\clbrdrt\brdrw10\brdrs\clbrdrr\brdrw10\brdrs\clbrdrb\brdrw10\brdrs \cellx8748\pard\intbl\ltrpar\nowidctlpar\f1 \cell\row";
richTextBox1.Rtf = richTextBox1.Rtf.Replace("hehehe", table);
Do you any better idea how to know the current position to insert a table into Rtf?? 你有没有更好的主意,怎样知道当前位置插入一个表转换为Rtf ? ?
thanks 谢谢
Well, as a better solution (maybe) you may look at EM_INSERTTABLE message at MSDN. Oh, sorry, it's not there. Some time ago I found i in Murray Sargent's blog here. 好吧,这可能是一个更好的解决方案,你可以在MSDN EM插入消息。哦,对不起,不是在这。前一段时间我在穆雷萨金特的博客发现的。
Unfortunately, it also very limited as in functionality as in versions (AFAIR you should use version 4 and above - that means you should load msftedit.dll instead of standard riched20.dll). 不幸的是,它还非常有限,因为功能的版本(AFFAIR应该使用版本4及以上——这意味着你应该加载msftedit.dll而不是标准riched20.dll)。
You are trying to make a big job (tables in RichEdit). Hope you'll achive desired results. Good luck.
你正在努力工作(RichEdit的中的表)。希望你能达到想要的结果。祝你好运。