192 lines
9.5 KiB
VB.net
192 lines
9.5 KiB
VB.net
Imports System.ComponentModel
|
|
Imports System.IO
|
|
|
|
Public Class Form177
|
|
Dim notifi As Integer
|
|
Private Sub ComboBox1_SelectedValueChanged(sender As Object, e As EventArgs) Handles ComboBox1.SelectedValueChanged
|
|
If ComboBox1.SelectedItem = "Tous les jours" Then
|
|
Label2.Show()
|
|
Label3.Hide()
|
|
Label4.Show()
|
|
ComboBox4.Hide()
|
|
ComboBox2.Show()
|
|
ComboBox3.Show()
|
|
Button1.Show()
|
|
ComboBox5.Show()
|
|
Else
|
|
ComboBox2.Show()
|
|
ComboBox3.Show()
|
|
ComboBox4.Show()
|
|
Label2.Show()
|
|
Label3.Show()
|
|
Label4.Show()
|
|
Button1.Show()
|
|
ComboBox5.Show()
|
|
End If
|
|
End Sub
|
|
|
|
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
|
|
If ComboBox1.SelectedItem = "Tous les jours" Then
|
|
If ComboBox2.SelectedItem = "" Or ComboBox3.SelectedItem = "" Then
|
|
MsgBox("Merci de sélectionner une heurs et une minute", MsgBoxStyle.Exclamation)
|
|
Else
|
|
If ComboBox5.SelectedItem = "" Then
|
|
MsgBox("Merci de sélectionner être notifier", MsgBoxStyle.Exclamation)
|
|
Else
|
|
Dim sw1 As New StreamWriter(fichierconfigbackup)
|
|
sw1.WriteLine(1)
|
|
sw1.WriteLine(ComboBox2.SelectedItem)
|
|
sw1.WriteLine(ComboBox3.SelectedItem)
|
|
sw1.WriteLine(0)
|
|
sw1.WriteLine(notifi)
|
|
sw1.Close()
|
|
MsgBox("La configuration de la sauvegarde bien été enregistrer", MsgBoxStyle.Information)
|
|
Dim msg = MsgBox("Voulez-vous la lancer maintenant ?", MsgBoxStyle.YesNo)
|
|
If msg = MsgBoxResult.Yes Then
|
|
Form178.ShowDialog()
|
|
Else
|
|
Form3.Button25.Text = "Modifier la sauvegarde"
|
|
Form3.Button26.Show()
|
|
Form3.Button31.Show()
|
|
Close()
|
|
End If
|
|
End If
|
|
End If
|
|
Else
|
|
If ComboBox2.SelectedItem = "" Or ComboBox3.SelectedItem = "" Then
|
|
MsgBox("Merci de sélectionner une heurs et une minute", MsgBoxStyle.Exclamation)
|
|
Else
|
|
If ComboBox4.SelectedItem = "" Then
|
|
MsgBox("Merci de sélectionner un jour", MsgBoxStyle.Exclamation)
|
|
Else
|
|
If ComboBox5.SelectedItem = "" Then
|
|
MsgBox("Merci de sélectionner être notifier", MsgBoxStyle.Exclamation)
|
|
Else
|
|
Dim sw1 As New StreamWriter(fichierconfigbackup)
|
|
sw1.WriteLine(2)
|
|
sw1.WriteLine(ComboBox2.SelectedItem)
|
|
sw1.WriteLine(ComboBox3.SelectedItem)
|
|
sw1.WriteLine(ComboBox4.SelectedItem)
|
|
sw1.WriteLine(notifi)
|
|
sw1.Close()
|
|
MsgBox("La configuration de la sauvegarde bien été enregistrer", MsgBoxStyle.Information)
|
|
Dim msg = MsgBox("Voulez-vous la lancer maintenant ?", MsgBoxStyle.YesNo)
|
|
If msg = MsgBoxResult.Yes Then
|
|
Form179.ShowDialog()
|
|
Else
|
|
Form3.Button25.Text = "Modifier la sauvegarde"
|
|
Form3.Button26.Show()
|
|
Form3.Button31.Show()
|
|
Close()
|
|
End If
|
|
|
|
End If
|
|
End If
|
|
End If
|
|
End If
|
|
End Sub
|
|
|
|
Private Sub Form177_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)
|
|
Button1.BackColor = Color.FromArgb(64, 64, 64)
|
|
Button1.ForeColor = Color.White
|
|
Label1.ForeColor = Color.White
|
|
Label2.ForeColor = Color.White
|
|
Label3.ForeColor = Color.White
|
|
Label4.ForeColor = Color.White
|
|
ComboBox1.BackColor = Color.FromArgb(64, 64, 64)
|
|
ComboBox1.ForeColor = Color.White
|
|
ComboBox2.BackColor = Color.FromArgb(64, 64, 64)
|
|
ComboBox2.ForeColor = Color.White
|
|
ComboBox3.BackColor = Color.FromArgb(64, 64, 64)
|
|
ComboBox3.ForeColor = Color.White
|
|
ComboBox4.BackColor = Color.FromArgb(64, 64, 64)
|
|
ComboBox4.ForeColor = Color.White
|
|
ComboBox5.BackColor = Color.FromArgb(64, 64, 64)
|
|
ComboBox5.ForeColor = Color.White
|
|
ElseIf lines1a(0) = 3 Then
|
|
Me.BackColor = Color.FromArgb(Form1.colorbackA, Form1.colorbackR, Form1.colorbackG, Form1.colorbackB)
|
|
Button1.BackColor = Color.FromArgb(Form1.colorbackA, Form1.colorbackR, Form1.colorbackG, Form1.colorbackB)
|
|
Button1.ForeColor = Color.FromArgb(Form1.themeforecoloA, Form1.themeforecoloR, Form1.themeforecoloG, Form1.themeforecoloB)
|
|
Label1.ForeColor = Color.FromArgb(Form1.themeforecoloA, Form1.themeforecoloR, Form1.themeforecoloG, Form1.themeforecoloB)
|
|
Label2.ForeColor = Color.FromArgb(Form1.themeforecoloA, Form1.themeforecoloR, Form1.themeforecoloG, Form1.themeforecoloB)
|
|
Label3.ForeColor = Color.FromArgb(Form1.themeforecoloA, Form1.themeforecoloR, Form1.themeforecoloG, Form1.themeforecoloB)
|
|
Label4.ForeColor = Color.FromArgb(Form1.themeforecoloA, Form1.themeforecoloR, Form1.themeforecoloG, Form1.themeforecoloB)
|
|
ComboBox1.BackColor = Color.FromArgb(Form1.colorbackA, Form1.colorbackR, Form1.colorbackG, Form1.colorbackB)
|
|
ComboBox1.ForeColor = Color.FromArgb(Form1.themeforecoloA, Form1.themeforecoloR, Form1.themeforecoloG, Form1.themeforecoloB)
|
|
ComboBox2.BackColor = Color.FromArgb(Form1.colorbackA, Form1.colorbackR, Form1.colorbackG, Form1.colorbackB)
|
|
ComboBox2.ForeColor = Color.FromArgb(Form1.themeforecoloA, Form1.themeforecoloR, Form1.themeforecoloG, Form1.themeforecoloB)
|
|
ComboBox3.BackColor = Color.FromArgb(Form1.colorbackA, Form1.colorbackR, Form1.colorbackG, Form1.colorbackB)
|
|
ComboBox3.ForeColor = Color.FromArgb(Form1.themeforecoloA, Form1.themeforecoloR, Form1.themeforecoloG, Form1.themeforecoloB)
|
|
ComboBox4.BackColor = Color.FromArgb(Form1.colorbackA, Form1.colorbackR, Form1.colorbackG, Form1.colorbackB)
|
|
ComboBox4.ForeColor = Color.FromArgb(Form1.themeforecoloA, Form1.themeforecoloR, Form1.themeforecoloG, Form1.themeforecoloB)
|
|
ComboBox5.BackColor = Color.FromArgb(Form1.colorbackA, Form1.colorbackR, Form1.colorbackG, Form1.colorbackB)
|
|
ComboBox5.ForeColor = Color.FromArgb(Form1.themeforecoloA, Form1.themeforecoloR, Form1.themeforecoloG, Form1.themeforecoloB)
|
|
Else
|
|
|
|
End If
|
|
|
|
|
|
Dim lines5() As String = File.ReadAllLines(fichierconfigbackup)
|
|
If lines5(0) = 1 Then
|
|
ComboBox1.SelectedItem = "Tous les jours"
|
|
ComboBox2.SelectedItem = lines5(1)
|
|
ComboBox3.SelectedItem = lines5(2)
|
|
If lines5(4) = 0 Then
|
|
ComboBox5.SelectedItem = "Ne pas être notifier"
|
|
ElseIf lines5(4) = 1 Then
|
|
ComboBox5.SelectedItem = "Au lancement de la sauvegarde"
|
|
ElseIf lines5(4) = 2 Then
|
|
ComboBox5.SelectedItem = "Quand la sauvegarde est terminée"
|
|
ElseIf lines5(4) = 3 Then
|
|
ComboBox5.SelectedItem = "Les deux"
|
|
End If
|
|
ElseIf lines5(0) = 2 Then
|
|
ComboBox1.SelectedItem = "Par moins"
|
|
ComboBox2.SelectedItem = lines5(1)
|
|
ComboBox3.SelectedItem = lines5(2)
|
|
ComboBox4.SelectedItem = lines5(3)
|
|
If lines5(4) = 0 Then
|
|
ComboBox5.SelectedItem = "Ne pas être notifier"
|
|
ElseIf lines5(4) = 1 Then
|
|
ComboBox5.SelectedItem = "Au lancement de la sauvegarde"
|
|
ElseIf lines5(4) = 2 Then
|
|
ComboBox5.SelectedItem = "Quand la sauvegarde est terminée"
|
|
ElseIf lines5(4) = 3 Then
|
|
ComboBox5.SelectedItem = "Les deux"
|
|
End If
|
|
End If
|
|
End Sub
|
|
|
|
Private Sub Form177_Closing(sender As Object, e As CancelEventArgs) Handles Me.Closing
|
|
Dim lines5() As String = File.ReadAllLines(fichierconfigbackup)
|
|
If lines5(0) = 1 Then
|
|
Form3.Label37.Text = "Type : tous les jours"
|
|
Form3.Label38.Text = "Heurs: " & lines5(1) & "h" & lines5(2)
|
|
Form3.Label37.Show()
|
|
Form3.Label38.Show()
|
|
Form3.Label40.Hide()
|
|
ElseIf lines5(0) = 2 Then
|
|
Form3.Label37.Text = "type: par moins"
|
|
Form3.Label38.Text = "Heurs: " & lines5(1) & "h" & lines5(2)
|
|
Form3.Label40.Text = "Le jours: " & lines5(3)
|
|
Form3.Label37.Show()
|
|
Form3.Label38.Show()
|
|
Form3.Label40.Show()
|
|
End If
|
|
End Sub
|
|
Private Sub ComboBox5_SelectedValueChanged(sender As Object, e As EventArgs) Handles ComboBox5.SelectedValueChanged
|
|
If ComboBox5.SelectedItem = "Ne pas être notifier" Then
|
|
notifi = 0
|
|
ElseIf ComboBox5.SelectedItem = "Au lancement de la sauvegarde" Then
|
|
notifi = 1
|
|
ElseIf ComboBox5.SelectedItem = "Quand la sauvegarde est terminée" Then
|
|
notifi = 2
|
|
ElseIf ComboBox5.SelectedItem = "Les deux" Then
|
|
notifi = 3
|
|
End If
|
|
End Sub
|
|
End Class |