77 lines
3.7 KiB
VB.net
77 lines
3.7 KiB
VB.net
Imports System.ComponentModel
|
|
Imports System.IO
|
|
|
|
Public Class Form198
|
|
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
|
|
|
|
If Directory.Exists(dosprofils & "/" & TextBox1.Text & "/") = True Then
|
|
MsgBox("Le profil: " & TextBox1.Text & " est déjà créer", MsgBoxStyle.Exclamation)
|
|
TextBox1.Clear()
|
|
Else
|
|
Try
|
|
Directory.CreateDirectory(dosprofils & "/" & TextBox1.Text & "/")
|
|
Dim sw1 As New StreamWriter(dosprofils & "/" & TextBox1.Text & "/" & "default.txt")
|
|
sw1.WriteLine(0)
|
|
sw1.Close()
|
|
GunaCirclePictureBox1.Image.Save(dosprofils & "/" & TextBox1.Text & "/" & "photo.png")
|
|
GunaCirclePictureBox1.Image.Dispose()
|
|
MsgBox("Le profil: " & TextBox1.Text & " a bien été créer", MsgBoxStyle.Information)
|
|
Close()
|
|
Catch ex As Exception
|
|
MsgBox("Des caractères interdit son de votre nom", MsgBoxStyle.Exclamation)
|
|
End Try
|
|
End If
|
|
End Sub
|
|
|
|
Private Sub GunaCirclePictureBox1_Click(sender As Object, e As EventArgs) Handles GunaCirclePictureBox1.Click
|
|
If OpenFileDialog1.ShowDialog = 1 Then
|
|
GunaCirclePictureBox1.Image = Image.FromFile(OpenFileDialog1.FileName)
|
|
End If
|
|
End Sub
|
|
|
|
Private Sub Form198_Load(sender As Object, e As EventArgs) Handles MyBase.Load
|
|
Dim lines1a() As String = File.ReadAllLines(théme)
|
|
|
|
If lines1a(0) = 2 Then
|
|
Me.BackColor = Color.FromArgb(64, 64, 64)
|
|
Label1.BackColor = Color.FromArgb(64, 64, 64)
|
|
GunaCirclePictureBox1.BackColor = Color.FromArgb(64, 64, 64)
|
|
TextBox1.BackColor = Color.FromArgb(64, 64, 64)
|
|
Button1.BackColor = Color.FromArgb(64, 64, 64)
|
|
Label1.ForeColor = Color.White
|
|
TextBox1.ForeColor = Color.White
|
|
Button1.ForeColor = Color.White
|
|
ElseIf lines1a(0) = 3 Then
|
|
Me.BackColor = Color.FromArgb(Form1.colorbackA, Form1.colorbackR, Form1.colorbackG, Form1.colorbackB)
|
|
Label1.BackColor = Color.FromArgb(Form1.colorbackA, Form1.colorbackR, Form1.colorbackG, Form1.colorbackB)
|
|
GunaCirclePictureBox1.BackColor = Color.FromArgb(Form1.colorbackA, Form1.colorbackR, Form1.colorbackG, Form1.colorbackB)
|
|
TextBox1.BackColor = Color.FromArgb(Form1.colorbackA, Form1.colorbackR, Form1.colorbackG, Form1.colorbackB)
|
|
Button1.BackColor = Color.FromArgb(Form1.colorbackA, Form1.colorbackR, Form1.colorbackG, Form1.colorbackB)
|
|
Label1.ForeColor = Color.FromArgb(Form1.themeforecoloA, Form1.themeforecoloR, Form1.themeforecoloG, Form1.themeforecoloB)
|
|
TextBox1.ForeColor = Color.FromArgb(Form1.themeforecoloA, Form1.themeforecoloR, Form1.themeforecoloG, Form1.themeforecoloB)
|
|
Button1.ForeColor = Color.FromArgb(Form1.themeforecoloA, Form1.themeforecoloR, Form1.themeforecoloG, Form1.themeforecoloB)
|
|
End If
|
|
|
|
End Sub
|
|
|
|
Private Sub Form198_Closing(sender As Object, e As CancelEventArgs) Handles Me.Closing
|
|
ComboBox1.Items.Clear()
|
|
For Each fichier As String In IO.Directory.GetDirectories(dosprofils)
|
|
Dim info As New IO.DirectoryInfo(fichier)
|
|
ComboBox1.Items.Add(info.Name)
|
|
Next
|
|
|
|
coutprofils = ComboBox1.Items.Count
|
|
|
|
Form3.Label43.Text = "Nombre de profils: " & coutprofils
|
|
|
|
ComboBox1.Items.Remove(nomprofils)
|
|
|
|
If ComboBox1.Items.Count = 0 Then
|
|
Form1.ChangerDeProfilsToolStripMenuItem.Visible = False
|
|
Else
|
|
Form1.ChangerDeProfilsToolStripMenuItem.Visible = True
|
|
End If
|
|
ComboBox1.Items.Clear()
|
|
End Sub
|
|
End Class |