Le code ne marche pas, besoins d'aide

nathan -  
kurth Messages postés 21 Date d'inscription   Statut Membre Dernière intervention   -
Bonjour,
j'ai récupéré un code à cette adresse: http://stackoverflow.com/questions/13583494/change-the-color-of-a-line-or-a-word-in-a-richtextbox
Mais le code VB ne ne marche pas j'ai essayé de le modifier mais il se passe rien.
voila ce que j'ai:
Private Sub Test()
For Each i As Integer In RichTextBox1.Lines.Length

Dim Text As String = RichTextBox1.Lines(i)
RichTextBox1.Select(RichTextBox1.GetFirstCharIndexFromLine(i), Text.Length)
RichTextBox1.SelectionColor = ColorForLine(Text)
Next
End Sub

Private Function ColorForLine(Line As String) As color
If Line.Contains("Processing", ) Then
Return ColorForLine.Green
End If
End Function

Merci
A voir également:

1 réponse

kurth Messages postés 21 Date d'inscription   Statut Membre Dernière intervention   1
 
Bonjour,
dans le code :
Private Function ColorForLine(Line As String) As color

"color" n'est pas un argument valide donc ça ne peut pas fonctionner
0