Select MsgBox(tmp, vbYesNo) 'si oui alors on en fait part Case vbYes emplacement.Replace(tmp, "") Case vbNo MsgBox("no") Case Else Me.Close() End Select
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionDim depart = mot.IndexOf(vbCr & vbLf) messagebox.show(evenement.Substring(depart)
Imports System.IO Public Class Form1 Dim TargetFile As IO.StreamWriter Dim DernierPoint As Point Dim MouMouseDown As Boolean Private Sub diminuer_MouseLeave(ByVal sender As Object, ByVal e As System.EventArgs) Handles diminuer.MouseLeave diminuer.BackgroundImage = My.Resources.diminuer End Sub Private Sub diminuer_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles diminuer.MouseMove diminuer.BackgroundImage = My.Resources.diminuerOn End Sub Private Sub agrandir_MouseLeave(ByVal sender As Object, ByVal e As System.EventArgs) Handles agrandir.MouseLeave agrandir.BackgroundImage = My.Resources.agrandir End Sub Private Sub agrandir_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles agrandir.MouseMove agrandir.BackgroundImage = My.Resources.agrandirOn End Sub Private Sub fermer_MouseLeave(ByVal sender As Object, ByVal e As System.EventArgs) Handles fermer.MouseLeave fermer.BackgroundImage = My.Resources.fermer End Sub Private Sub fermer_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles fermer.MouseMove fermer.BackgroundImage = My.Resources.fermerOn End Sub Private Sub diminuer_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles diminuer.Click Me.WindowState = FormWindowState.Minimized End Sub Private Sub fermer_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles fermer.Click Close() End Sub Private Sub agrandir_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles agrandir.Click If Me.WindowState = FormWindowState.Normal Then Me.WindowState = FormWindowState.Maximized ElseIf Me.WindowState = FormWindowState.Maximized Then Me.WindowState = FormWindowState.Normal End If End Sub Private Sub Form1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseDown MouMouseDown = True DernierPoint = New Point(e.X, e.Y) End Sub Private Sub Form1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseMove If MouMouseDown Then Me.Location = New Point(Me.Left - (DernierPoint.X - e.X), Me.Top - (DernierPoint.Y - e.Y)) End If End Sub Private Sub Form1_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseUp MouMouseDown = False End Sub Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Timer1.Interval = 10000 Timer1.Start() TextBox1.Focus() TextBox1.Select() End Sub Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Try TargetFile = New IO.StreamWriter("evenement.txt", True) Catch MessageBox.Show("Erreur") End Try Try TargetFile.Write(DateTimePicker1.Value) TargetFile.Write(" " & TextBox1.Text) TargetFile.WriteLine(vbNewLine) Catch MessageBox.Show("Error") End Try TargetFile.Close() TextBox1.Clear() End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click MsgBox(System.IO.File.ReadAllText("evenement.txt")) End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click Dim mot As String = Date.Now.Date 'le mot a chercher Dim tmp As String 'une variable temporaire Dim emplacement As String = "evenement.txt" 'l'emplacement du fichier FileOpen(1, emplacement, OpenMode.Input) 'on ouvre le fichier à analyser Do Until EOF(1) 'tant qu'on est pas à la fin du fichier: tmp = LineInput(1) 'on lis la ligne et on la stock dans la variable If ((InStr(tmp, mot)) > 0) Then 'on vérifie si le mot rechercher ne serais pas dans la ligne Select Case MsgBox(tmp & vbNewLine & vbNewLine & "Supprimer cet évènement?", MsgBoxStyle.OkCancel) 'si oui alors on en fait part Case vbOK emplacement.Replace(tmp, "") MsgBox("ok") Case Else End Select End If Loop FileClose(1) End Sub Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click Try TargetFile = New IO.StreamWriter("evenement.txt", False) Catch MessageBox.Show("Erreur") End Try Try TargetFile.WriteLine() Catch MessageBox.Show("Error") End Try TargetFile.Close() TextBox1.Clear() End Sub Private Sub CheckBox1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox1.CheckedChanged Dim key As Microsoft.Win32.RegistryKey If CheckBox1.Checked = True Then key = Microsoft.Win32.Registry.CurrentUser.OpenSubKey("Software\Microsoft\Windows\CurrentVersion\Run", True) key.SetValue("LecteurTakam", Application.StartupPath + "\LecteurTakam.exe") ElseIf CheckBox1.Checked = False Then key = Microsoft.Win32.Registry.CurrentUser.OpenSubKey("Software\Microsoft\Windows\CurrentVersion\Run", True) key.DeleteValue("LecteurTakam") End If End Sub End Class
c'est toujours des programmes personnel
emplacement.Replace(tmp, "") MsgBox("ok")