richtextbox文本格式问题 [英] richtextbox text format problem

查看:187
本文介绍了richtextbox文本格式问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

" 我尝试解决问题
我的表单上有RichTextBox.在代码中,我通过myRichBox.Text读取了其文本
并通过电子邮件将此文本发送给其他人.
但是通过邮件发送文本的格式与Richtextbox屏幕上的视图不同.

如何阅读在richtextbox上看到的文本?
"

我问了这个问题,但意识到我的问题有点不同.
当我写

第一行是"lll ll"
"ooo oo"在第二行
尽管我写了相同数量的字符,但我看不到相同大小的文字,因为"o"比"l"更胖
如何强制richTextBox但每个字符都在点上,这样
字符的大小将不重要

谢谢

" I try to deal with a problem
I have RichTextBox at my form .At code I read its text by myRichBox.Text
and send this text to people by email.
but format sending text by mail is not same as view at screen at richtextbox.

How can I read text what I see at richtextbox ?
"

I asked this question but realize my problem is a bit different.
when I write

" lll ll" at first line
" ooo oo" at second line
my text isnt seen at the same size althought I write same number of character because "o" is fatter than "l"
how can I force richTextBox but each character at on point so that
size of character will be no important

Thanks

推荐答案

应该有RichTextBox的某些属性,以代替纯文本格式文本.
There should be some property of RichTextBox to read formatted text in-place of plain-text.


据我所知,电子邮件可以格式化为Html或文本,而RichTextBox可以格式化为rtf(因为rtf表示RichTextFormat).

首先,您必须确保您的电子邮件格式为Html.
您可以在RichTextBox.Rtf属性中访问rtf字符串,在那里您可以看到rtf字符串的外观.

肯定有可能将rtf转换为html,您可以在互联网上寻找一种可能性,但我希望我可以帮助找到一种获得答案的方法.

对不起,我的英语不好


有一篇关于RTF转换的文章:)
在这里查看:编写自己的RTF转换器
as far as i know a E-Mail can be formatted as Html or Text and a richtextbox is formatted as rtf (because rtf means RichTextFormat).

At first you have to make sure, that you E-Mail is formatted as Html.
You can access the rtf string in the RichTextBox.Rtf Property, there you can see how a rtf string looks like.

There is surely a possibility to transform a rtf to html, you can look for a possibility on the internet, but i hope i could help find a way to get a answer.

Sorry for my bad english


There is a article for RTF convertion :)
Look here: Writing Your Own RTF Converter


感谢您的回答
但我想强制RichTextBox以相同的宽度绘制每个字符
然后我选择"Courier New"字体进行管理,它可以正常工作
但我还是有问题.
如果用户从其他地方复制了字体不合适的文本,
文字似乎不是我想要的.我要制作复制的文字"Courier New"字体.我该怎么办?
Thanks for your answer
but I want to force RichTextBox to draw each charecter at same width
and I manage it by choose ''Courier New'' font , and it works
but I have still problem.
if user copy text from another place which font is not suitable ,
text doesnt seem what I want.I want to make copied text ''Courier New'' font. How can I do ?


这篇关于richtextbox文本格式问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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