Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
Private Sub rtbTextCode_Change()
Dim strLine As String
Dim wrdWord() As Word
If Len(rtbTextCode.Text) = 0 Then Exit Sub
strLine = GetTextLine(rtbTextCode.Text, CLng(RowCount))
If Len(strLine) = 0 Or rtbTextCode.SelStart = 0 Then Exit Sub
strLine = GetLastWord(strLine)
If IsKeyWord(strLine) = True Then
rtbTextCode.SelStart = rtbTextCode.SelStart - Len(strLine)
rtbTextCode.SelLength = Len(strLine)
rtbTextCode.SelColor = vbBlue
rtbTextCode.SelLength = 0
rtbTextCode.SelStart = rtbTextCode.SelStart + Len(strLine) + 1
rtbTextCode.SelColor = vbBlack
ElseIf IsString(strLine) = True Then
rtbTextCode.SelStart = rtbTextCode.SelStart - Len(strLine)
rtbTextCode.SelLength = Len(strLine)
rtbTextCode.SelColor = vbRed
rtbTextCode.SelLength = 0
rtbTextCode.SelStart = rtbTextCode.SelStart + Len(strLine)
Else
'do nothing
rtbTextCode.SelColor = vbGreen
End If
End Sub
o meu problema nao esta na IsKeyWord(strLine), porque recebo as palavras(a nao ser que tambem receba os espaços). alguem me pode explicar como posso resolver correctamente a sintax de cor?
Carregando comentários...