富文本框问题.. [英] richtext box problem..

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

问题描述

我有2个Richtextboxes.

Richtextbox1和Richtextbox2.

我想将richtextbox1的字体样式和字体颜色设置为richtextbox2.

EG
richtextbox1包含文本"Hi ...",richtextbox2包含文本您好吗?".

我只想根据richtextbox1的样式更改richtextbox2中的"Hi ..."字体样式,而不影响整个richtextbox2的文本.

I have 2 Richtextboxes.

Richtextbox1 and Richtextbox2.

I want to set the font style and font color of richtextbox1 to richtextbox2.

EG
richtextbox1 contains text "Hi..." and richtextbox2 contains text "How are you?".

I want to change only font style of "Hi..." in richtextbox2 according the style of richtextbox1 not affect the whole richtextbox2''s text.

推荐答案

我怀疑还有其他方法来解析,找到匹配的文本,然后使用应用于匹配文本的样式.
I doubt there would be other way then to parse, find the matching text and then use the styles applied to the matched texts.


我假设这是一种聊天实用程序,需要用户之间进行区分.

在将文本添加到另一个文本框中时,请确保未在其中添加文本,而是在追加文本,以保持格式.

RichTextBox.AppendText()是您所需要的.
I am presuming this is some kind of chat utility that requires differentiation between users.

As you add the text to the other textbox, ensure that it is not adding to it but is appending, that way the formating is maintained.

RichTextBox.AppendText() is what you need.


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

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