COLORATEUR DE SYNTHAX

cs_furioso Messages postés 22 Date d'inscription mercredi 6 mars 2002 Statut Membre Dernière intervention 24 septembre 2002 - 27 août 2002 à 12:54
leptidev Messages postés 206 Date d'inscription mercredi 30 janvier 2002 Statut Membre Dernière intervention 4 décembre 2007 - 28 août 2002 à 01:08
Ou puis-je trouver un activex ou un code source qui color les synthax html ou des synthax que je personnalise dans un fichier?VITE DE L'AIDE!!!!

1 réponse

leptidev Messages postés 206 Date d'inscription mercredi 30 janvier 2002 Statut Membre Dernière intervention 4 décembre 2007
28 août 2002 à 01:08
Fais toi même ta source, crée un tablo avec les mots à colorer et leur couleur :
Private Type MotAndCouleur
mot As string
couleur as string
End type
Dim tablo() as MotAndCouleur
'Lit ensuite ton textBox

Public Function balises_insert()
Exit Function
'Un long texte HTML a été insérer
'On met à jour toutes les balises
text1.SetFocus
text1.SelStart = 10
text1.Width = 0
text1.Height = 0
For i = 0 To 14 ' on browse tout le tableau
found = 1
foundf = 1
position = 1
mdi.diane.DrawPanel i, "Colorisation"
Do While InStr(position, frmEditeur.text1.Text, tabBalises(i))
position = InStr(position, text1.Text, tabBalises(i)) + 1
'recherche de balises ouvrantes
found = InStr(found, text1.Text, "<" & tabBalises(i)) + 1
If found = 1 Then GoTo exit1
text1.SelStart = found - 2
' on le sélectionne
text1.SelLength = Len(tabBalises(i)) + 1
' on le colorie
text1.SelColor = tabCouleur(i)
exit1:
Loop
'recherche de balises fermantes
foundf = InStr(foundf, text1.Text, "</" & tabBalises(i) & ">") + 1
If foundf = 1 Then GoTo exit2
text1.SelStart = foundf
' on le sélectionne
text1.SelLength = Len(tabBalises(i)) + 1
' on le colorie
text1.SelColor = tabCouleur(i)
exit2:
'Loop
Next
' on le déselectionne
text1.SelStart = text1.SelLength + text1.SelStart
Call redimensionner
mdi.diane.reset
'colorie_php
Exit Function
End Function

Une source en vrac, élimine ce qui va pas et tien moi au courant si besoin
0
Rejoignez-nous