Files
2026-06-18 14:15:48 +02:00

313 lines
18 KiB
VB.net

Imports System.ComponentModel
Imports System.IO
Public Class Form37
Dim renom As Integer = 0
Private Sub Form37_Load(sender As Object, e As EventArgs) Handles MyBase.Load
ComboBox1.SelectedIndex = 1
ComboBox2.SelectedIndex = 2
PictureBox1.Image = Image.FromFile(dostheme & "\" & Form36.ListBox1.SelectedItem & "\btplay.png")
PictureBox2.Image = Image.FromFile(dostheme & "\" & Form36.ListBox1.SelectedItem & "\btpause.png")
PictureBox3.Image = Image.FromFile(dostheme & "\" & Form36.ListBox1.SelectedItem & "\btstop.png")
PictureBox4.Image = Image.FromFile(dostheme & "\" & Form36.ListBox1.SelectedItem & "\btpleinécran.png")
PictureBox5.Image = Image.FromFile(dostheme & "\" & Form36.ListBox1.SelectedItem & "\btlike.png")
PictureBox6.Image = Image.FromFile(dostheme & "\" & Form36.ListBox1.SelectedItem & "\btdislike.png")
PictureBox7.Image = Image.FromFile(dostheme & "\" & Form36.ListBox1.SelectedItem & "\bttéléchargement.png")
PictureBox8.Image = Image.FromFile(dostheme & "\" & Form36.ListBox1.SelectedItem & "\btsuivant.png")
PictureBox9.Image = Image.FromFile(dostheme & "\" & Form36.ListBox1.SelectedItem & "\btprésédent.png")
PictureBox10.Image = Image.FromFile(dostheme & "\" & Form36.ListBox1.SelectedItem & "\btvolumemute.png")
Dim lines1() As String = File.ReadAllLines(dostheme & "\" & Form36.ListBox1.SelectedItem & "\colorplans.txt")
If lines1(0) = 255 And lines1(1) = 240 And lines1(2) = 240 And lines1(3) = 240 Then
ComboBox2.SelectedIndex = 0
ElseIf lines1(0) = 255 And lines1(1) = 64 And lines1(2) = 64 And lines1(3) = 64 Then
ComboBox2.SelectedIndex = 1
Else
ComboBox2.SelectedIndex = 2
PictureBox11.BackColor = Color.FromArgb(lines1(0), lines1(1), lines1(2), lines1(3))
End If
Dim lines2() As String = File.ReadAllLines(dostheme & "\" & Form36.ListBox1.SelectedItem & "\colorpolice.txt")
PictureBox13.BackColor = Color.FromArgb(lines2(0), lines2(1), lines2(2), lines2(3))
Dim lines3() As String = File.ReadAllLines(dostheme & "\" & Form36.ListBox1.SelectedItem & "\colorprograbar.txt")
PictureBox14.BackColor = Color.FromArgb(lines3(0), lines3(1), lines3(2), lines3(3))
PictureBox15.BackColor = Color.FromArgb(lines3(5), lines3(6), lines3(7), lines3(8))
GunaMetroTrackBar1.TrackColor = PictureBox15.BackColor
GunaMetroTrackBar1.TrackHoverColor = PictureBox15.BackColor
GunaMetroTrackBar1.TrackPressedColor = PictureBox15.BackColor
GunaMetroTrackBar1.TrackIdleColor = PictureBox14.BackColor
Dim lines102() As String = File.ReadAllLines(couleur)
If lines102(0) = 0 Then
ChromeTabcontrol2.SquareColor = Color.FromArgb(255, 128, 0)
ElseIf lines102(0) = 1 Then
ChromeTabcontrol2.SquareColor = Color.Green
ElseIf lines102(0) = 2 Then
ChromeTabcontrol2.SquareColor = Color.Blue
ElseIf lines102(0) = 3 Then
ChromeTabcontrol2.SquareColor = Color.Red
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)
ComboBox1.BackColor = Color.FromArgb(64, 64, 64)
ComboBox2.BackColor = Color.FromArgb(64, 64, 64)
ForeColor = Color.White
TextBox1.ForeColor = Color.White
ComboBox1.ForeColor = Color.White
ComboBox2.ForeColor = Color.White
Label1.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)
ComboBox1.BackColor = Color.FromArgb(Form1.colorbackA, Form1.colorbackR, Form1.colorbackG, Form1.colorbackB)
ComboBox2.BackColor = Color.FromArgb(Form1.colorbackA, Form1.colorbackR, Form1.colorbackG, Form1.colorbackB)
ForeColor = Color.FromArgb(Form1.themeforecoloA, Form1.themeforecoloR, Form1.themeforecoloG, Form1.themeforecoloB)
TextBox1.ForeColor = Color.FromArgb(Form1.themeforecoloA, Form1.themeforecoloR, Form1.themeforecoloG, Form1.themeforecoloB)
ComboBox1.ForeColor = Color.FromArgb(Form1.themeforecoloA, Form1.themeforecoloR, Form1.themeforecoloG, Form1.themeforecoloB)
ComboBox2.ForeColor = Color.FromArgb(Form1.themeforecoloA, Form1.themeforecoloR, Form1.themeforecoloG, Form1.themeforecoloB)
Label1.ForeColor = Color.FromArgb(Form1.themeforecoloA, Form1.themeforecoloR, Form1.themeforecoloG, Form1.themeforecoloB)
End If
End Sub
Private Sub PictureBox1_Click(sender As Object, e As EventArgs) Handles PictureBox1.Click
If OpenFileDialog1.ShowDialog = 1 Then
PictureBox1.Image.Dispose()
PictureBox1.Image = Image.FromFile(OpenFileDialog1.FileName)
End If
End Sub
Private Sub PictureBox2_Click(sender As Object, e As EventArgs) Handles PictureBox2.Click
If OpenFileDialog1.ShowDialog = 1 Then
PictureBox2.Image.Dispose()
PictureBox2.Image = Image.FromFile(OpenFileDialog1.FileName)
End If
End Sub
Private Sub PictureBox3_Click(sender As Object, e As EventArgs) Handles PictureBox3.Click
If OpenFileDialog1.ShowDialog = 1 Then
PictureBox3.Image.Dispose()
PictureBox3.Image = Image.FromFile(OpenFileDialog1.FileName)
End If
End Sub
Private Sub PictureBox4_Click(sender As Object, e As EventArgs) Handles PictureBox4.Click
If OpenFileDialog1.ShowDialog = 1 Then
PictureBox4.Image.Dispose()
PictureBox4.Image = Image.FromFile(OpenFileDialog1.FileName)
End If
End Sub
Private Sub PictureBox5_Click(sender As Object, e As EventArgs) Handles PictureBox5.Click
If OpenFileDialog1.ShowDialog = 1 Then
PictureBox5.Image.Dispose()
PictureBox5.Image = Image.FromFile(OpenFileDialog1.FileName)
End If
End Sub
Private Sub PictureBox6_Click(sender As Object, e As EventArgs) Handles PictureBox6.Click
If OpenFileDialog1.ShowDialog = 1 Then
PictureBox6.Image.Dispose()
PictureBox6.Image = Image.FromFile(OpenFileDialog1.FileName)
End If
End Sub
Private Sub PictureBox7_Click(sender As Object, e As EventArgs) Handles PictureBox7.Click
If OpenFileDialog1.ShowDialog = 1 Then
PictureBox7.Image.Dispose()
PictureBox7.Image = Image.FromFile(OpenFileDialog1.FileName)
End If
End Sub
Private Sub PictureBox8_Click(sender As Object, e As EventArgs) Handles PictureBox8.Click
If OpenFileDialog1.ShowDialog = 1 Then
PictureBox8.Image.Dispose()
PictureBox8.Image = Image.FromFile(OpenFileDialog1.FileName)
End If
End Sub
Private Sub PictureBox9_Click(sender As Object, e As EventArgs) Handles PictureBox9.Click
If OpenFileDialog1.ShowDialog = 1 Then
PictureBox9.Image.Dispose()
PictureBox9.Image = Image.FromFile(OpenFileDialog1.FileName)
End If
End Sub
Private Sub PictureBox10_Click(sender As Object, e As EventArgs) Handles PictureBox10.Click
If OpenFileDialog1.ShowDialog = 1 Then
PictureBox10.Image.Dispose()
PictureBox10.Image = Image.FromFile(OpenFileDialog1.FileName)
End If
End Sub
Private Sub ComboBox2_SelectedValueChanged(sender As Object, e As EventArgs) Handles ComboBox2.SelectedValueChanged
If ComboBox2.SelectedItem = "Clair" Then
PictureBox11.BackColor = System.Drawing.SystemColors.Control
ElseIf ComboBox2.SelectedItem = "Sombre" Then
PictureBox11.BackColor = Color.FromArgb(64, 64, 64)
Else
PictureBox11.BackColor = System.Drawing.SystemColors.Control
End If
End Sub
Private Sub PictureBox14_Click(sender As Object, e As EventArgs) Handles PictureBox14.Click
If ColorDialog1.ShowDialog = 1 Then
PictureBox14.BackColor = ColorDialog1.Color
GunaMetroTrackBar1.TrackIdleColor = ColorDialog1.Color
End If
End Sub
Private Sub PictureBox13_Click(sender As Object, e As EventArgs) Handles PictureBox13.Click
If ColorDialog1.ShowDialog = 1 Then
PictureBox13.BackColor = ColorDialog1.Color
End If
End Sub
Private Sub PictureBox15_Click(sender As Object, e As EventArgs) Handles PictureBox15.Click
If ColorDialog1.ShowDialog = 1 Then
PictureBox15.BackColor = ColorDialog1.Color
GunaMetroTrackBar1.TrackColor = ColorDialog1.Color
GunaMetroTrackBar1.TrackHoverColor = ColorDialog1.Color
GunaMetroTrackBar1.TrackPressedColor = ColorDialog1.Color
End If
End Sub
Private Sub PictureBox11_Click(sender As Object, e As EventArgs) Handles PictureBox11.Click
If ComboBox2.SelectedItem = "Clair" Then
ElseIf ComboBox2.SelectedItem = "Sombre" Then
Else
If ColorDialog1.ShowDialog = 1 Then
PictureBox11.BackColor = ColorDialog1.Color
End If
End If
End Sub
Private Sub Form37_Closing(sender As Object, e As CancelEventArgs) Handles Me.Closing
If TextBox1.Text = "" Then
e.Cancel = True
MsgBox("Merci d'entrer un nom", MsgBoxStyle.Critical)
Else
Dim msg = MsgBox("Voulez-vous enregistrer les modifications du Thème: " & Form36.ListBox1.SelectedItem, MsgBoxStyle.YesNo)
If msg = MsgBoxResult.Yes Then
Try
PictureBox1.Image.Save(dostheme & "\" & Form36.ListBox1.SelectedItem & "\btplay2.png")
PictureBox2.Image.Save(dostheme & "\" & Form36.ListBox1.SelectedItem & "\btpause2.png")
PictureBox3.Image.Save(dostheme & "\" & Form36.ListBox1.SelectedItem & "\btstop2.png")
PictureBox4.Image.Save(dostheme & "\" & Form36.ListBox1.SelectedItem & "\btpleinécran2.png")
PictureBox5.Image.Save(dostheme & "\" & Form36.ListBox1.SelectedItem & "\btlike2.png")
PictureBox6.Image.Save(dostheme & "\" & Form36.ListBox1.SelectedItem & "\btdislike2.png")
PictureBox7.Image.Save(dostheme & "\" & Form36.ListBox1.SelectedItem & "\bttéléchargement2.png")
PictureBox8.Image.Save(dostheme & "\" & Form36.ListBox1.SelectedItem & "\btsuivant2.png")
PictureBox9.Image.Save(dostheme & "\" & Form36.ListBox1.SelectedItem & "\btprésédent2.png")
PictureBox10.Image.Save(dostheme & "\" & Form36.ListBox1.SelectedItem & "\btvolumemute2.png")
Dim sw1 As New StreamWriter(dostheme & "\" & Form36.ListBox1.SelectedItem.ToString & "\colorpolice.txt")
sw1.WriteLine(PictureBox13.BackColor.A)
sw1.WriteLine(PictureBox13.BackColor.R)
sw1.WriteLine(PictureBox13.BackColor.G)
sw1.WriteLine(PictureBox13.BackColor.B)
sw1.Close()
Dim sw2 As New StreamWriter(dostheme & "\" & Form36.ListBox1.SelectedItem.ToString & "\colorplans.txt")
sw2.WriteLine(PictureBox11.BackColor.A)
sw2.WriteLine(PictureBox11.BackColor.R)
sw2.WriteLine(PictureBox11.BackColor.G)
sw2.WriteLine(PictureBox11.BackColor.B)
sw2.Close()
Dim sw3 As New StreamWriter(dostheme & "\" & Form36.ListBox1.SelectedItem.ToString & "\colorprograbar.txt")
sw3.WriteLine(PictureBox14.BackColor.A)
sw3.WriteLine(PictureBox14.BackColor.R)
sw3.WriteLine(PictureBox14.BackColor.G)
sw3.WriteLine(PictureBox14.BackColor.B)
sw3.WriteLine(" ")
sw3.WriteLine(PictureBox15.BackColor.A)
sw3.WriteLine(PictureBox15.BackColor.R)
sw3.WriteLine(PictureBox15.BackColor.G)
sw3.WriteLine(PictureBox15.BackColor.B)
sw3.Close()
If ComboBox1.SelectedIndex = 0 Then
PictureBox12.Image.Save(dostheme & "\" & Form36.ListBox1.SelectedItem & "\backgroud.png")
End If
PictureBox1.Image.Dispose()
PictureBox2.Image.Dispose()
PictureBox3.Image.Dispose()
PictureBox4.Image.Dispose()
PictureBox5.Image.Dispose()
PictureBox6.Image.Dispose()
PictureBox7.Image.Dispose()
PictureBox8.Image.Dispose()
PictureBox9.Image.Dispose()
PictureBox10.Image.Dispose()
PictureBox1.Image = My.Resources.cropped_note_radomisol_musique
PictureBox2.Image = My.Resources.cropped_note_radomisol_musique
PictureBox3.Image = My.Resources.cropped_note_radomisol_musique
PictureBox4.Image = My.Resources.cropped_note_radomisol_musique
PictureBox5.Image = My.Resources.cropped_note_radomisol_musique
PictureBox6.Image = My.Resources.cropped_note_radomisol_musique
PictureBox7.Image = My.Resources.cropped_note_radomisol_musique
PictureBox8.Image = My.Resources.cropped_note_radomisol_musique
PictureBox9.Image = My.Resources.cropped_note_radomisol_musique
PictureBox10.Image = My.Resources.cropped_note_radomisol_musique
File.Delete(dostheme & "\" & Form36.ListBox1.SelectedItem & "\btdislike.png")
File.Delete(dostheme & "\" & Form36.ListBox1.SelectedItem & "\btlike.png")
File.Delete(dostheme & "\" & Form36.ListBox1.SelectedItem & "\btpause.png")
File.Delete(dostheme & "\" & Form36.ListBox1.SelectedItem & "\btplay.png")
File.Delete(dostheme & "\" & Form36.ListBox1.SelectedItem & "\btpleinécran.png")
File.Delete(dostheme & "\" & Form36.ListBox1.SelectedItem & "\btprésédent.png")
File.Delete(dostheme & "\" & Form36.ListBox1.SelectedItem & "\btstop.png")
File.Delete(dostheme & "\" & Form36.ListBox1.SelectedItem & "\btsuivant.png")
File.Delete(dostheme & "\" & Form36.ListBox1.SelectedItem & "\bttéléchargement.png")
File.Delete(dostheme & "\" & Form36.ListBox1.SelectedItem & "\btvolumemute.png")
My.Computer.FileSystem.RenameFile(dostheme & "\" & Form36.ListBox1.SelectedItem & "\btdislike2.png", "btdislike.png")
My.Computer.FileSystem.RenameFile(dostheme & "\" & Form36.ListBox1.SelectedItem & "\btlike2.png", "btlike.png")
My.Computer.FileSystem.RenameFile(dostheme & "\" & Form36.ListBox1.SelectedItem & "\btpause2.png", "btpause.png")
My.Computer.FileSystem.RenameFile(dostheme & "\" & Form36.ListBox1.SelectedItem & "\btplay2.png", "btplay.png")
My.Computer.FileSystem.RenameFile(dostheme & "\" & Form36.ListBox1.SelectedItem & "\btpleinécran2.png", "btpleinécran.png")
My.Computer.FileSystem.RenameFile(dostheme & "\" & Form36.ListBox1.SelectedItem & "\btprésédent2.png", "btprésédent.png")
My.Computer.FileSystem.RenameFile(dostheme & "\" & Form36.ListBox1.SelectedItem & "\btstop2.png", "btstop.png")
My.Computer.FileSystem.RenameFile(dostheme & "\" & Form36.ListBox1.SelectedItem & "\btsuivant2.png", "btsuivant.png")
My.Computer.FileSystem.RenameFile(dostheme & "\" & Form36.ListBox1.SelectedItem & "\bttéléchargement2.png", "bttéléchargement.png")
My.Computer.FileSystem.RenameFile(dostheme & "\" & Form36.ListBox1.SelectedItem & "\btvolumemute2.png", "btvolumemute.png")
If TextBox1.Text = Form36.ListBox1.SelectedItem Then
Else
Try
My.Computer.FileSystem.RenameDirectory(dostheme & "\" & Form36.ListBox1.SelectedItem & "\", TextBox1.Text)
Form3.ComboBox3.Items.Remove(Form36.ListBox1.SelectedItem)
Form3.ComboBox3.Items.Add(TextBox1.Text)
renom = 1
Catch ex As Exception
e.Cancel = True
MsgBox("Une erreur est survenue soit le nom du thème contient de caractère interdit ou le thème existe déjà", MsgBoxStyle.Exclamation)
Exit Sub
End Try
End If
MsgBox("Le thème: " & Form36.ListBox1.SelectedItem.ToString & " a bien été modifier", MsgBoxStyle.Information)
If renom = 1 Then
Form36.ListBox1.Items.Remove(Form36.ListBox1.SelectedItem)
Form36.ListBox1.Items.Add(TextBox1.Text)
Form36.ListBox1.SelectedItem = TextBox1.Text
renom = 0
End If
Catch ex As Exception
MsgBox("Une erreur est survenue", MsgBoxStyle.Critical)
End Try
Else
End If
End If
End Sub
End Class