1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
| Public Class Form6
Dim i As Integer
Private Sub Form6_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim s1 As String
Try
FileOpen(1, "noisette2.txt", OpenMode.Input)
Do
s1 = LineInput(1)
DataGridView1.Rows.Add(New String() {s1})
Loop Until EOF(1)
Catch ex As Exception
Finally
FileClose(1)
End Try
End Sub
Private Sub FermerToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles FermerToolStripMenuItem.Click
Dim boucle As Boolean
boucle = True
Try
FileOpen(1, "noisette2.txt", OpenMode.Output)
For i = 0 To DataGridView1.Rows.Count - 1
Dim row As DataGridViewRow = DataGridView1.Rows(i)
If row.Cells(0).Value <> "" Then
PrintLine(1, row.Cells(0).Value)
End If
Next
Catch
Finally
FileClose(1)
End Try
Me.Hide()
End Sub
Private Sub SupprimerLhistoriqueToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SupprimerLhistoriqueToolStripMenuItem.Click
DataGridView1.RowCount = 1
DataGridView1.Rows.Clear()
End Sub
End Class |