Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Imports System.ComponentModel
- Imports System.IO
- Public Class Bureau
- Dim p As String = Application.StartupPath & "\Onix's OS\"
- Dim ps As String = p & "Session\"
- Dim pb As String = ps & "Bureau\"
- Dim pid As String = p & "IconData\"
- Dim menuOpen As Boolean = False
- Dim calandarOpen As Boolean = False
- Dim sx As Integer = Screen.PrimaryScreen.Bounds.Width
- Dim sy As Integer = Screen.PrimaryScreen.Bounds.Height
- Dim Process1M As Boolean
- Dim Process2M As Boolean
- Dim Icon1InMoov As Boolean = False
- Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
- Label1.Text = TimeOfDay.ToString("hh : mm : ss")
- Label2.Text = Date.Today
- End Sub
- Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
- Me.Close()
- System.Threading.Thread.Sleep(750)
- Form1.Close()
- End Sub
- Private Sub PictureBox1_Click(sender As Object, e As EventArgs) Handles PictureBox1.Click
- If menuOpen = True Then
- Panel2.Visible = False
- menuOpen = False
- ElseIf menuOpen = False Then
- Panel2.Visible = True
- menuOpen = True
- End If
- End Sub
- Private Sub Label1_Click(sender As Object, e As EventArgs) Handles Label1.Click
- If ContextMenuStrip1.Visible = False Then
- If calandarOpen = True Then
- calandarOpen = False
- MonthCalendar1.Visible = False
- ElseIf calandarOpen = False Then
- MonthCalendar1.Visible = True
- calandarOpen = True
- End If
- End If
- End Sub
- Private Sub Label2_Click(sender As Object, e As EventArgs) Handles Label2.Click
- If ContextMenuStrip1.Visible = False Then
- If calandarOpen = True Then
- calandarOpen = False
- MonthCalendar1.Visible = False
- ElseIf calandarOpen = False Then
- MonthCalendar1.Visible = True
- calandarOpen = True
- End If
- Else
- End If
- End Sub
- Private Sub Bureau_Load(sender As Object, e As EventArgs) Handles MyBase.Click
- MonthCalendar1.Visible = False
- Panel2.Visible = False
- End Sub
- Private Sub FermerWindowsToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles FermerWindowsToolStripMenuItem.Click
- Form1.Close()
- End Sub
- Private Sub Bureau_Load_1(sender As Object, e As EventArgs) Handles MyBase.Load
- System.Threading.Thread.Sleep(1500)
- If IO.Directory.Exists(ps & "Bureau") = False Then
- IO.Directory.CreateDirectory(ps & "Bureau")
- Else
- ListBox1.Items.Clear()
- For Each FileName As String In Directory.GetFiles(ps & "Bureau")
- Dim FileExt As String = Path.GetExtension(FileName)
- Me.ListBox1.Items.Add(Path.GetFileNameWithoutExtension(FileName & FileExt))
- Next FileName
- End If
- If IO.Directory.Exists(pid) = False Then
- IO.Directory.CreateDirectory(pid)
- IO.Directory.CreateDirectory(pid & "icon1")
- IO.File.WriteAllText(pid & "icon1\X", Icon1.Location.X)
- IO.File.WriteAllText(pid & "icon1\Y", Icon1.Location.Y)
- Else
- If IO.Directory.Exists(pid & "icon1") = False Then
- IO.Directory.CreateDirectory(pid & "icon1")
- Else
- 'icon name
- If IO.File.Exists(pid & "icon1\name") = False Then
- IO.File.WriteAllText(pid & "icon1\name", "Programme 1")
- Else
- Icon1name.Text = IO.File.ReadAllText(pid & "icon1\name")
- End If
- 'icon Location
- If IO.File.Exists(pid & "icon1\X") And IO.File.Exists(pid & "icon1\Y") Then
- Icon1.Location = New Point(IO.File.ReadAllText(pid & "icon1\X"), IO.File.ReadAllText(pid & "icon1\Y")) 'load location
- End If
- 'Icon imagge
- If IO.File.Exists(pid & "icon1\iconimgloc") = True Then
- If IO.File.Exists(IO.File.ReadAllText(pid & "icon1\iconimgloc")) Then
- Icon1Icon.BackgroundImage = Image.FromFile(IO.File.ReadAllText(pid & "icon1\iconimgloc"))
- Else
- MessageBox.Show("L'image servant d'icône pour l'icône 1 a été supprimé !")
- IO.File.Delete(pid & "icon1\iconimgloc")
- Icon1Icon.BackgroundImage = Nothing
- End If
- 'icon programe location
- If IO.File.Exists(pid & "icon1\prloc") = True Then
- End If
- End If
- End If
- End If
- End Sub
- Private Sub AfficherLesÉlémentDuBureauToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles AfficherLesÉlémentDuBureauToolStripMenuItem.Click
- ListBox1.Visible = True
- End Sub
- Private Sub AfficherToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles AfficherToolStripMenuItem.Click
- ListBox1.Visible = True
- Button2.Visible = True
- End Sub
- Private Sub CacherToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles CacherToolStripMenuItem.Click
- ListBox1.Visible = False
- Button2.Visible = False
- End Sub
- Private Sub Timer2_Tick(sender As Object, e As EventArgs) Handles Timer2.Tick
- If IO.Directory.Exists(ps & "Bureau") = False Then
- IO.Directory.CreateDirectory(ps & "Bureau")
- Else
- ListBox1.Items.Clear()
- For Each FileName As String In Directory.GetFiles(ps & "Bureau")
- Dim FileExt As String = Path.GetExtension(FileName)
- Me.ListBox1.Items.Add(Path.GetFileNameWithoutExtension(FileName & FileExt))
- Next FileName
- End If
- End Sub
- Private Sub OuvrirLemplacementToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles OuvrirLemplacementToolStripMenuItem.Click
- Process.Start(ps & "Bureau")
- End Sub
- Private Sub ListBox1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ListBox1.DoubleClick
- Dim Fname As String
- Fname = pb & ListBox1.SelectedItem
- If IO.File.Exists(pb & ListBox1.SelectedItem) Then
- If Path.GetExtension(Fname) = ".txt" Then
- Notepad.Show()
- System.Threading.Thread.Sleep(500)
- Notepad.RichTextBox1.Text = IO.File.ReadAllText(Fname)
- Notepad.Label1.Text = Path.GetFileNameWithoutExtension(Fname)
- Else
- MessageBox.Show("Impossible d'ouvrir le fichier pour le moment, Ce type de fichier ( " & Path.GetExtension(Fname) & " ) n'est pas suporté pour le moment", "Erreur lors de l'ouverture du fichier")
- End If
- End If
- End Sub
- Private Sub DocumentTexteToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles DocumentTexteToolStripMenuItem.Click
- Notepad.Show()
- End Sub
- Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
- Dim Fname As String
- Fname = pb & ListBox1.SelectedItem
- If IO.File.Exists(pb & ListBox1.SelectedItem) Then
- IO.File.Delete(pb & ListBox1.SelectedItem)
- ListBox1.SelectedItem = ""
- End If
- End Sub
- Private Sub MinimiserToolStripMenuItem_Click(sender As Object, e As EventArgs)
- End Sub
- Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
- If Button3.Text = "Notepad" Then
- If Process1M = True Then
- Notepad.Opacity = 100
- Process1M = False
- ElseIf Process1M = False Then
- Notepad.Opacity = 0
- Process1M = True
- End If
- ElseIf Button3.Text = "Navigateur internet" Then
- If Process1M = True Then
- NavigateurInternet.Opacity = 100
- Process1M = False
- ElseIf Process1M = False Then
- NavigateurInternet.Opacity = 0
- Process1M = True
- End If
- End If
- End Sub
- Private Sub FermerToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles FermerToolStripMenuItem.Click
- If Button3.Text = "Notepad" Then
- Notepad.Close()
- NotepadSaveDialog.Close()
- ElseIf Button3.Text = "Navigateur internet" Then
- NavigateurInternet.Close()
- End If
- End Sub
- Private Sub PictureBox2_Click(sender As Object, e As EventArgs) Handles PictureBox2.Click
- 'same as button3
- If Button3.Text = "Notepad" Then
- If Process1M = True Then
- Notepad.Opacity = 100
- Process1M = False
- ElseIf Process1M = False Then
- Notepad.Opacity = 0
- Process1M = True
- End If
- ElseIf Button3.Text = "Navigateur internet" Then
- If Process1M = True Then
- NavigateurInternet.Opacity = 100
- Process1M = False
- ElseIf Process1M = False Then
- NavigateurInternet.Opacity = 0
- Process1M = True
- End If
- End If
- End Sub
- Private Sub Icon1Icon_Click(sender As Object, e As EventArgs) Handles Icon1Icon.Click
- End Sub
- Private Sub Icon1Icon_MouseDown(sender As Object, e As MouseEventArgs) Handles Icon1Icon.MouseDown
- Icon1InMoov = True
- End Sub
- Private Sub Icon1Icon_MouseMove(sender As Object, e As MouseEventArgs) Handles Icon1Icon.MouseMove
- If Icon1InMoov = True Then
- Icon1.Location = New Point(MousePosition.X, MousePosition.Y)
- IO.File.WriteAllText(pid & "icon1\X", Icon1.Location.X)
- IO.File.WriteAllText(pid & "icon1\Y", Icon1.Location.Y)
- End If
- End Sub
- Private Sub Icon1Icon_MouseUp(sender As Object, e As MouseEventArgs) Handles Icon1Icon.MouseUp
- Icon1InMoov = False
- End Sub
- Private Sub AfinéAUnProgrammeToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles AfinéAUnProgrammeToolStripMenuItem.Click
- IconOption.Show()
- System.Threading.Thread.Sleep(500)
- IconOption.Label1.Text = "Modifier les paramètres pour l'icône 1"
- IconOption.NumericUpDown1.Value = 1
- IconOption.TextBox3.Text = Icon1name.Text
- Dim p As New Process
- Dim pname As String
- If IO.File.Exists(pid & "icon1\prloc") Then
- pname = IO.File.ReadAllText(pid & "icon1\prloc")
- If IO.File.Exists(pid & "icon1\prloc") = True And IO.File.Exists(pname) Then
- IconOption.TextBox2.Text = pname
- Else
- IconOption.TextBox2.Text = ""
- End If
- End If
- If File.Exists(pid & "icon1\iconimgloc") Then
- If File.Exists(IO.File.ReadAllText(pid & "icon1\iconimgloc")) Then
- IconOption.TextBox1.Text = IO.File.ReadAllText(pid & "icon1\iconimgloc")
- Else
- IconOption.TextBox1.Text = ""
- End If
- End If
- End Sub
- Private Sub Icon1name_Click(sender As Object, e As EventArgs) Handles Icon1name.DoubleClick
- End Sub
- Private Sub Icon1Icon_DoubleClick(sender As Object, e As EventArgs) Handles Icon1Icon.DoubleClick
- Dim p As New Process
- Dim pname As String = IO.File.ReadAllText(pid & "icon1\prloc")
- If IO.File.Exists(pid & "icon1\prloc") = True Then
- p.StartInfo.FileName = pname
- p.Start()
- End If
- End Sub
- Private Sub Bureau_Closing(sender As Object, e As CancelEventArgs) Handles Me.Closing
- System.Threading.Thread.Sleep(1500)
- End Sub
- Private Sub OuvrirLeProgrammeToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles OuvrirLeProgrammeToolStripMenuItem.Click
- Dim p As New Process
- Dim pname As String
- If IO.File.Exists(pid & "icon1\prloc") Then
- pname = IO.File.ReadAllText(pid & "icon1\prloc")
- If IO.File.Exists(pid & "icon1\prloc") = True And IO.File.Exists(pname) Then
- p.StartInfo.FileName = pname
- p.Start()
- End If
- End If
- End Sub
- Private Sub Icon1_DoubleClick(sender As Object, e As EventArgs) Handles Icon1.DoubleClick
- Dim p As New Process
- Dim pname As String
- If IO.File.Exists(pid & "icon1\prloc") Then
- pname = IO.File.ReadAllText(pid & "icon1\prloc")
- If IO.File.Exists(pid & "icon1\prloc") = True And IO.File.Exists(pname) Then
- p.StartInfo.FileName = pname
- p.Start()
- End If
- End If
- End Sub
- Private Sub ToolStripMenuItem1_Click(sender As Object, e As EventArgs) Handles ToolStripMenuItem1.Click
- If Button4.Text = "Notepad" Then
- Notepad.Close()
- NotepadSaveDialog.Close()
- ElseIf Button4.Text = "Navigateur internet" Then
- NavigateurInternet.Close()
- End If
- End Sub
- Private Sub Button5_Click(sender As Object, e As EventArgs) Handles Button5.Click
- NavigateurInternet.Show()
- End Sub
- Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
- If Button4.Text = "Notepad" Then
- If Process1M = True Then
- Notepad.Opacity = 100
- Process1M = False
- ElseIf Process1M = False Then
- Notepad.Opacity = 0
- Process1M = True
- End If
- ElseIf Button4.Text = "Navigateur internet" Then
- If Process2M = True Then
- NavigateurInternet.Opacity = 100
- Process2M = False
- ElseIf Process2M = False Then
- NavigateurInternet.Opacity = 0
- Process2M = True
- End If
- End If
- End Sub
- Private Sub PictureBox3_Click(sender As Object, e As EventArgs) Handles PictureBox3.Click
- If Button4.Text = "Notepad" Then
- If Process1M = True Then
- Notepad.Opacity = 100
- Process1M = False
- ElseIf Process1M = False Then
- Notepad.Opacity = 0
- Process1M = True
- End If
- ElseIf Button4.Text = "Navigateur internet" Then
- If Process2M = True Then
- NavigateurInternet.Opacity = 100
- Process2M = False
- ElseIf Process2M = False Then
- NavigateurInternet.Opacity = 0
- Process2M = True
- End If
- End If
- End Sub
- Private Sub Button6_Click(sender As Object, e As EventArgs) Handles Button6.Click
- Process.Start("com.epicgames.launcher://apps/Fortnite?action=launch&silent=true")
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement