当前位置: 代码迷 >> VB Dotnet >> 怎么获取字符串中的指定颜色显示为红色呢
  详细解决方案

怎么获取字符串中的指定颜色显示为红色呢

热度:104   发布时间:2016-04-25 02:18:32.0
如何获取字符串中的指定颜色显示为红色呢
 Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click

        Dim str1 As String = "0123456"
        ' str1 = QBColor(15)
        MsgBox(str1)
    End Sub

我要str1中的5显示为红色的5,该怎么做呢?
还有整个str1显示为红色,那又怎么做呢?
------解决方案--------------------
Dim str1 As String = "01234<span color='#ff0000'>5</span>6"
------解决方案--------------------
WinForm和WebForm 程序?

WebForm 程序

Dim str1 As String = "01234<span color='#ff0000'>5</span>6" 

WinForm程序的话
只能用多个便签设置显示颜色了
------解决方案--------------------
整个显示为红色应该可以给.ForeColor属性赋值。
------解决方案--------------------
http://bbs.csdn.net/topics/390193830你看下这个,DataGridView的扩展
  相关解决方案