文本控件

.Net技术 码拜 9年前 (2015-07-18) 967次浏览 0个评论

c#r如何做到一串字符的一个字符颜色不同

5分

#1

使用RichTextBox文本控件,使用html代码控制。

使用string的replace函数,比如把字符#全部换成<font color=”red”>#</font>

30分

#2

asp:Literal   id=”Test”  value=”你好”   cs文件
string.Replace(“好”,“<font   style=”color:red”></font>”)

#3

回复1楼:


CodeBye 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权 , 转载请注明文本控件
喜欢 (0)
[1034331897@qq.com]
分享 (0)

文章评论已关闭!