Le code ne marche pas, besoins d'aide

Fermé
nathan - 17 sept. 2013 à 22:48
kurth Messages postés 21 Date d'inscription lundi 4 janvier 2010 Statut Membre Dernière intervention 24 septembre 2013 - 19 sept. 2013 à 17:18
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 lundi 4 janvier 2010 Statut Membre Dernière intervention 24 septembre 2013 1
19 sept. 2013 à 17:18
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