那些并不是文字,而是用Print方法画上去的。
你可以用picturebox显示文字。
sample:
Me.CurrentX = 100
Me.ForeColor = vbRed
Me.Print "1"
Me.ForeColor = vbGreen
Me.Print "2"
End Sub
你可以用picturebox显示文字。
sample:
Me.CurrentX = 100
Me.ForeColor = vbRed
Me.Print "1"
Me.ForeColor = vbGreen
Me.Print "2"
End Sub
可以弄一个透明的东东如label设一个宽度只有一个字符,想办法让他移动到你要的字符上。
Option ExplicitPrivate Sub Form_Load()
RichTextBox1.SelColor = RGB(255, 0, 0)
End SubPrivate Sub RichTextBox1_KeyPress(KeyAscii As Integer)
Static num As Integer
If KeyAscii = 13 Then
RichTextBox1.SelLength = 0
Select Case num
Case 0
RichTextBox1.SelColor = RGB(255, 0, 0)
Case 1
RichTextBox1.SelColor = RGB(0, 0, 255)
Case 2
RichTextBox1.SelColor = RGB(0, 255, 0)
End Select
num = num + 1
If num = 3 Then num = 0
End If
End Sub
Private Sub RTB1_KeyPress(KeyAscii As Integer)
Static a As Integer
With RTB1
.SelStart = Len(RTB1.Text)
.SelLength = 1
.SelColor = RGB(a * 10, 0, 0)
a = a + 1
End With
End Sub
Private Sub RTB1_KeyPress(KeyAscii As Integer)
Static a As Integer
With RTB1
.SelStart = Len(RTB1.Text)
.SelLength = 1
.SelColor = RGB(a * 10, 0, 0)
a = a + 1
End With
End Sub
Private Sub RTB1_KeyPress(KeyAscii As Integer)
Dim inta As Integer
Dim stra As String
Dim strb As String
On Error Resume Next
With RTB1
inta = Len(.Text)
stra = Mid(.Text, inta, 1)
strb = Mid(Text1.Text, inta, 1)
If stra = strb Then
.SelStart = inta - 1
.SelLength = 1
.SelColor = RGB(0, 0, 0)
Else
.SelStart = inta - 1
.SelLength = 1
.SelColor = RGB(255, 0, 0)
End If
.SelLength = 0
.SelStart = inta
End With
End Sub---------------------------------------------------------
Montaque==Digitalboy==Houyongfeng==Monkey