- Public strTexte, strChaine As System.String
-
- Private Sub mnuFichierRechercher_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuFichierRechercher.Click
- Dim i, j As System.Int32
- strTexte = rctTexte.Text
- strChaine = txtLettre.Text
-
- For i = 0 To strTexte.Length - strChaine.Length Step 1
- If strTexte.Substring(i, strChaine.Length) = strChaine Then
- j += 1
- rctTexte.SelectionStart = i
- rctTexte.SelectionLength = strChaine.Length
- rctTexte.SelectionColor = clrChaine.Color
- rctTexte.SelectionFont = fntChaine.Font
- End If
-
- Next
- lblMessage.Text = j
- End Sub
-
- Private Sub mnuFichierReset_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuFichierReset.Click
- Dim i, j As System.Int32
- strTexte = rctTexte.Text
- strChaine = txtLettre.Text
-
- For i = 0 To strTexte.Length - strChaine.Length Step 1
- If strTexte.Substring(i, strChaine.Length) = strChaine Then
- j += 1
- rctTexte.SelectionStart = i
- rctTexte.SelectionLength = strChaine.Length
- rctTexte.SelectionColor = Color.Black
- rctTexte.SelectionFont = New Font("Verdana", 8, FontStyle.Regular)
- End If
-
- Next
- lblMessage.Text = ""
- txtLettre.Text = ""
- txtLettre.Focus()
- End Sub
-
- Private Sub mnuFichierOuvrir_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuFichierOuvrir.Click
- Dim strLineofText, strAllText As System.String
- ofdFichier.Filter = "Fichiers texte(*.txt)|*.txt|Fichiers ini(*.ini)|*.ini|Fichiers inf(*.inf)|*.inf|Fichiers log(*.log)|*.log"
- If ofdFichier.ShowDialog = DialogResult.OK Then
- FileOpen(1, ofdFichier.FileName, OpenMode.Input)
- Do Until EOF(1)
- strLineofText = LineInput(1)
- strAllText &= strLineofText & vbCrLf
- Loop
- rctTexte.Text = strAllText
- strTexte = rctTexte.Text
- FileClose(1)
- End If
- txtLettre.Focus()
- End Sub
-
- Private Sub mnuOptionsCouleur_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuOptionsCouleur.Click
- clrChaine.ShowDialog()
- End Sub
-
- Private Sub mnuOptionsPolice_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuOptionsPolice.Click
- fntChaine.ShowDialog()
- End Sub
-
- Private Sub mnuFichierEffacer_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuFichierEffacer.Click
- rctTexte.Text = ""
- txtLettre.Text = ""
- End Sub
-
- Private Sub mnuFichierQuitter_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuFichierQuitter.Click
- Me.Close()
- End Sub
Public strTexte, strChaine As System.String
Private Sub mnuFichierRechercher_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuFichierRechercher.Click
Dim i, j As System.Int32
strTexte = rctTexte.Text
strChaine = txtLettre.Text
For i = 0 To strTexte.Length - strChaine.Length Step 1
If strTexte.Substring(i, strChaine.Length) = strChaine Then
j += 1
rctTexte.SelectionStart = i
rctTexte.SelectionLength = strChaine.Length
rctTexte.SelectionColor = clrChaine.Color
rctTexte.SelectionFont = fntChaine.Font
End If
Next
lblMessage.Text = j
End Sub
Private Sub mnuFichierReset_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuFichierReset.Click
Dim i, j As System.Int32
strTexte = rctTexte.Text
strChaine = txtLettre.Text
For i = 0 To strTexte.Length - strChaine.Length Step 1
If strTexte.Substring(i, strChaine.Length) = strChaine Then
j += 1
rctTexte.SelectionStart = i
rctTexte.SelectionLength = strChaine.Length
rctTexte.SelectionColor = Color.Black
rctTexte.SelectionFont = New Font("Verdana", 8, FontStyle.Regular)
End If
Next
lblMessage.Text = ""
txtLettre.Text = ""
txtLettre.Focus()
End Sub
Private Sub mnuFichierOuvrir_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuFichierOuvrir.Click
Dim strLineofText, strAllText As System.String
ofdFichier.Filter = "Fichiers texte(*.txt)|*.txt|Fichiers ini(*.ini)|*.ini|Fichiers inf(*.inf)|*.inf|Fichiers log(*.log)|*.log"
If ofdFichier.ShowDialog = DialogResult.OK Then
FileOpen(1, ofdFichier.FileName, OpenMode.Input)
Do Until EOF(1)
strLineofText = LineInput(1)
strAllText &= strLineofText & vbCrLf
Loop
rctTexte.Text = strAllText
strTexte = rctTexte.Text
FileClose(1)
End If
txtLettre.Focus()
End Sub
Private Sub mnuOptionsCouleur_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuOptionsCouleur.Click
clrChaine.ShowDialog()
End Sub
Private Sub mnuOptionsPolice_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuOptionsPolice.Click
fntChaine.ShowDialog()
End Sub
Private Sub mnuFichierEffacer_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuFichierEffacer.Click
rctTexte.Text = ""
txtLettre.Text = ""
End Sub
Private Sub mnuFichierQuitter_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuFichierQuitter.Click
Me.Close()
End Sub