LastF = 1 begin: d = Instr(LastF, RichTextBox.text, "bonjour",vbtextcompare) If d <> 0 then LastF = d + 1 richtextbox.selstart = d - 1 richtextbox.sellength = len("bonjour") richtextbox.selcolor = vbred Else exit sub End if goto begin
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionDim LastF As Integer LastF = 1 d = -1 Do While d <> 0 d = InStr(LastF, richtextbox.Text, "bonjour", vbTextCompare) If d <> 0 Then LastF = d + 1 richtextbox.SelStart = d - 1 richtextbox.SelLength = Len("bonjour") richtextbox.selcolor = vbRed End If Loop