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
| Private Sub CliquerPourVoirLaListeDesChapitresToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles CliquerPourVoirLaListeDesChapitresToolStripMenuItem.Click
Me.BackColor = Color.Pink
Me.BackgroundImage = Nothing
Titre.Visible = True
'My.Computer.FileSystem.OpenTextFileReader("D:\DVD\ListeDesChapitres.txt")
Dim Lecteur As New StreamReader("D:\DVD\ListeDesChapitres.txt")
Dim Longueur As Integer
Dim Ligne As String
Do
Ligne = Lecteur.ReadLine
If Lecteur.ReadLine = Nothing Then Exit Do
Longueur = Ligne.Length
Dim Etiq As New Label
Etiq.AutoSize = False
If Longueur <> 0 Then
Etiq.Name = "Chapitre" & i.ToString
Etiq.Font = Font
Etiq.Text = Ligne
'MsgBox("# " & Ligne & " #")
Etiq.Width = Longueur
Etiq.Top = 50 + 20 * i
Etiq.Left = 100
Controls.Add(Etiq)
i += 1
End If
Loop 'Until Lecteur.ReadLine = Nothing
Lecteur.Close()
End Sub |
Partager