89 lines
4.0 KiB
VB.net
89 lines
4.0 KiB
VB.net
Imports System.ComponentModel
|
|
Imports System.IO
|
|
Public Class addplaylist
|
|
Public renomezplaylist As Integer = 0
|
|
Private Sub TextBox1_TextChanged(sender As Object, e As EventArgs) Handles TextBox1.TextChanged
|
|
If renomezplaylist = 0 Then
|
|
Button1.Text = "Créer: " & TextBox1.Text
|
|
Else
|
|
Button1.Text = "Renommez: " & TextBox1.Text
|
|
End If
|
|
End Sub
|
|
|
|
Private Sub addplaylist_Load(sender As Object, e As EventArgs) Handles MyBase.Load
|
|
|
|
If renomezplaylist = 0 Then
|
|
Me.Text = "Créer une playlist"
|
|
Button1.Text = "Créer: "
|
|
TextBox1.Clear()
|
|
Else
|
|
renomezplaylist = 1
|
|
Me.Text = "Renommez: " & Form183.ComboBox1.SelectedItem
|
|
Button1.Text = "Renommez: "
|
|
TextBox1.Clear()
|
|
End If
|
|
|
|
|
|
Dim lines1a() As String = File.ReadAllLines(théme)
|
|
|
|
If lines1a(0) = 2 Then
|
|
Me.BackColor = Color.FromArgb(64, 64, 64)
|
|
TextBox1.BackColor = Color.FromArgb(64, 64, 64)
|
|
Label1.BackColor = Color.FromArgb(64, 64, 64)
|
|
Button1.BackColor = Color.FromArgb(64, 64, 64)
|
|
TextBox1.ForeColor = Color.White
|
|
Label1.ForeColor = Color.White
|
|
Button1.ForeColor = Color.White
|
|
ElseIf lines1a(0) = 3 Then
|
|
Me.BackColor = Color.FromArgb(Form1.colorbackA, Form1.colorbackR, Form1.colorbackG, Form1.colorbackB)
|
|
TextBox1.BackColor = Color.FromArgb(Form1.colorbackA, Form1.colorbackR, Form1.colorbackG, Form1.colorbackB)
|
|
Label1.BackColor = Color.FromArgb(Form1.colorbackA, Form1.colorbackR, Form1.colorbackG, Form1.colorbackB)
|
|
Button1.BackColor = Color.FromArgb(Form1.colorbackA, Form1.colorbackR, Form1.colorbackG, Form1.colorbackB)
|
|
TextBox1.ForeColor = Color.FromArgb(Form1.themeforecoloA, Form1.themeforecoloR, Form1.themeforecoloG, Form1.themeforecoloB)
|
|
Label1.ForeColor = Color.FromArgb(Form1.themeforecoloA, Form1.themeforecoloR, Form1.themeforecoloG, Form1.themeforecoloB)
|
|
Button1.ForeColor = Color.FromArgb(Form1.themeforecoloA, Form1.themeforecoloR, Form1.themeforecoloG, Form1.themeforecoloB)
|
|
Else
|
|
|
|
End If
|
|
|
|
|
|
|
|
End Sub
|
|
|
|
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
|
|
|
|
If Directory.Exists(dosplaylist & TextBox1.Text) = True Then
|
|
MsgBox("La playlist: " & TextBox1.Text & " existe déjà", MsgBoxStyle.Critical)
|
|
Else
|
|
If renomezplaylist = 1 Then
|
|
Try
|
|
My.Computer.FileSystem.RenameDirectory(dosplaylist & Form183.ComboBox1.SelectedItem, TextBox1.Text)
|
|
Form183.Button4.Text = "Renommez: " & TextBox1.Text
|
|
Form183.Text = " modifier: " & TextBox1.Text
|
|
MsgBox("La playlist: " & Form183.ComboBox1.SelectedItem & " a bien été renommez en " & TextBox1.Text, MsgBoxStyle.Information)
|
|
Form183.ComboBox1.Items.Clear()
|
|
For Each fichier As String In IO.Directory.GetDirectories(dosplaylist)
|
|
Dim info As New IO.DirectoryInfo(fichier)
|
|
Form183.ComboBox1.Items.Add(info.Name)
|
|
Next
|
|
Form183.ComboBox1.SelectedItem = TextBox1.Text
|
|
Close()
|
|
Catch ex As Exception
|
|
MsgBox("Les caractère /\ : * <> """" et ? sont interdit", MsgBoxStyle.Exclamation)
|
|
End Try
|
|
Else
|
|
Try
|
|
Directory.CreateDirectory(dosplaylist & TextBox1.Text)
|
|
MsgBox("La playlist: " & TextBox1.Text & " a bien été créer", MsgBoxStyle.Information)
|
|
Close()
|
|
Catch ex As Exception
|
|
MsgBox("Les caractère /\ : * <> """" et ? sont interdit", MsgBoxStyle.Exclamation)
|
|
End Try
|
|
End If
|
|
End If
|
|
End Sub
|
|
|
|
Private Sub addplaylist_Closing(sender As Object, e As CancelEventArgs) Handles Me.Closing
|
|
renomezplaylist = 0
|
|
End Sub
|
|
End Class |