Sunday, March 28

My Schedular Diary

Public Class Schedular
Private Sub MonthCalendar2_DateChanged(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DateRangeEventArgs) Handles MonthCalendar2.DateChanged
TextBox2.Text = MonthCalendar2.SelectionEnd.Year & "\" & MonthCalendar2.SelectionEnd.DayOfYear
Dim i, cipher As String
Try
If RichTextBox1.Visible = True Then
i = "D:\Diary\" & TextBox2.Text & "\todo.rtf"
If My.Computer.FileSystem.DirectoryExists("D:\Diary\" & "\" & TextBox2.Text) Then
cipher = My.Computer.FileSystem.ReadAllText(i)
' cipher = cipher.Replace("z", "a")
' cipher = cipher.Replace("y", "b")
' cipher = cipher.Replace("x", "c")
'cipher = cipher.Replace("w", "d")
'cipher = cipher.Replace("v", "e")
'cipher = cipher.Replace("u", "f")
'cipher = cipher.Replace("t", "g")
'cipher = cipher.Replace("s", "h")
'cipher = cipher.Replace("r", "i")
'cipher = cipher.Replace("q", "j")
' cipher = cipher.Replace("p", "k")
' cipher = cipher.Replace("o", "l")
' cipher = cipher.Replace("n", "m")
' cipher = cipher.Replace("m", "n")
' cipher = cipher.Replace("l", "o")
' cipher = cipher.Replace("k", "p")
' cipher = cipher.Replace("j", "q")
' cipher = cipher.Replace("i", "r")
' cipher = cipher.Replace("h", "s")
' cipher = cipher.Replace("g", "t")
' cipher = cipher.Replace("f", "u")
' cipher = cipher.Replace("e", "v")
' cipher = cipher.Replace("d", "w")
' cipher = cipher.Replace("c", "x")
' cipher = cipher.Replace("b", "y")
'cipher = cipher.Replace("a", "z")
RichTextBox1.Text = cipher
Else
RichTextBox1.Text = "There is nothing updated on this date!!"
End If
ElseIf RichTextBox2.Visible = True Then
i = "D:\Diary\" & TextBox2.Text & "\remind.rtf"
If My.Computer.FileSystem.DirectoryExists("D:\Diary\" & "\" & TextBox2.Text) Then
cipher = My.Computer.FileSystem.ReadAllText(i)
' cipher = cipher.Replace("z", "a")
' cipher = cipher.Replace("y", "b")
' cipher = cipher.Replace("x", "c")
'cipher = cipher.Replace("w", "d")
'cipher = cipher.Replace("v", "e")
'cipher = cipher.Replace("u", "f")
'cipher = cipher.Replace("t", "g")
'cipher = cipher.Replace("s", "h")
'cipher = cipher.Replace("r", "i")
'cipher = cipher.Replace("q", "j")
' cipher = cipher.Replace("p", "k")
' cipher = cipher.Replace("o", "l")
' cipher = cipher.Replace("n", "m")
' cipher = cipher.Replace("m", "n")
' cipher = cipher.Replace("l", "o")
' cipher = cipher.Replace("k", "p")
' cipher = cipher.Replace("j", "q")
' cipher = cipher.Replace("i", "r")
' cipher = cipher.Replace("h", "s")
' cipher = cipher.Replace("g", "t")
' cipher = cipher.Replace("f", "u")
' cipher = cipher.Replace("e", "v")
' cipher = cipher.Replace("d", "w")
' cipher = cipher.Replace("c", "x")
' cipher = cipher.Replace("b", "y")
'cipher = cipher.Replace("a", "z")

RichTextBox2.Text = cipher
Else
RichTextBox2.Text = "There is nothing updated on this date!!"
End If
ElseIf RichTextBox3.Visible = True Then
i = "D:\Diary\" & TextBox2.Text & "\Diary.rtf"
If My.Computer.FileSystem.DirectoryExists("D:\Diary\" & "\" & TextBox2.Text) Then
cipher = My.Computer.FileSystem.ReadAllText(i)
' cipher = cipher.Replace("z", "a")
' cipher = cipher.Replace("y", "b")
' cipher = cipher.Replace("x", "c")
'cipher = cipher.Replace("w", "d")
'cipher = cipher.Replace("v", "e")
'cipher = cipher.Replace("u", "f")
'cipher = cipher.Replace("t", "g")
'cipher = cipher.Replace("s", "h")
'cipher = cipher.Replace("r", "i")
'cipher = cipher.Replace("q", "j")
' cipher = cipher.Replace("p", "k")
' cipher = cipher.Replace("o", "l")
' cipher = cipher.Replace("n", "m")
' cipher = cipher.Replace("m", "n")
' cipher = cipher.Replace("l", "o")
' cipher = cipher.Replace("k", "p")
' cipher = cipher.Replace("j", "q")
' cipher = cipher.Replace("i", "r")
' cipher = cipher.Replace("h", "s")
' cipher = cipher.Replace("g", "t")
' cipher = cipher.Replace("f", "u")
' cipher = cipher.Replace("e", "v")
' cipher = cipher.Replace("d", "w")
' cipher = cipher.Replace("c", "x")
' cipher = cipher.Replace("b", "y")
'cipher = cipher.Replace("a", "z")

RichTextBox3.Text = cipher
Else
RichTextBox3.Text = "There is nothing updated on this date!!"
End If
End If
Catch ex As Exception
End Try
End Sub
Private Sub ToolStripComboBox2_SelectedIndexChanged1(ByVal sender As Object, ByVal e As System.EventArgs) Handles ToolStripComboBox2.SelectedIndexChanged
RichTextBox1.SelectionFont = New Font(ToolStripComboBox2.Text, RichTextBox1.SelectionFont.SizeInPoints)
End Sub
Private Sub ToolStripComboBox3_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripComboBox3.Click
RichTextBox1.SelectionFont = New Font(ToolStripComboBox2.Text, ToolStripComboBox3.Text)
End Sub
Private Sub SaveToolStripButton_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SaveToolStripButton.Click
If RichTextBox1.Visible = True Then
Dim cipher As String
cipher = RichTextBox1.Text
cipher = cipher + vbNewLine + vbNewLine
Dim i As String
i = "D:\Diary\" & TextBox2.Text & "\todo.rtf"
If My.Computer.FileSystem.DirectoryExists("D:\Diary\" & TextBox2.Text) Then
If My.Computer.FileSystem.FileExists(i) Then
My.Computer.FileSystem.DeleteFile(i)
End If
My.Computer.FileSystem.WriteAllText(i, cipher, True)
Else
My.Computer.FileSystem.CreateDirectory("D:\Diary\" & TextBox2.Text)
My.Computer.FileSystem.WriteAllText(i, cipher, True)
End If
ElseIf RichTextBox2.Visible = True Then
Dim cipher As String
cipher = RichTextBox2.Text
cipher = cipher + vbNewLine + vbNewLine
Dim i As String
i = "D:\Diary\" & TextBox2.Text & "\remind.rtf"
If My.Computer.FileSystem.DirectoryExists("D:\Diary\" & TextBox2.Text) Then
If My.Computer.FileSystem.FileExists(i) Then
My.Computer.FileSystem.DeleteFile(i)
End If
My.Computer.FileSystem.WriteAllText(i, cipher, True)
Else
My.Computer.FileSystem.CreateDirectory("D:\Diary\" & TextBox2.Text)
My.Computer.FileSystem.WriteAllText(i, cipher, True)
End If
ElseIf RichTextBox3.Visible = True Then
Dim cipher As String
cipher = RichTextBox3.Text
cipher = cipher + vbNewLine + vbNewLine
Dim i As String
i = "D:\Diary\" & TextBox2.Text & "\Diary.rtf"
If My.Computer.FileSystem.DirectoryExists("D:\Diary\" & TextBox2.Text) Then
If My.Computer.FileSystem.FileExists(i) Then
My.Computer.FileSystem.DeleteFile(i)
End If
My.Computer.FileSystem.WriteAllText(i, cipher, True)
Else
My.Computer.FileSystem.CreateDirectory("D:\Diary\" & TextBox2.Text)
My.Computer.FileSystem.WriteAllText(i, cipher, True)
End If
End If


End Sub
Private Sub CutToolStripButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CutToolStripButton.Click
RichTextBox1.Cut()
End Sub
Private Sub CopyToolStripButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CopyToolStripButton.Click
RichTextBox1.Copy()
End Sub
Private Sub PasteToolStripButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PasteToolStripButton.Click
RichTextBox1.Paste()
End Sub
Private Sub ToolStripButton20_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton20.Click
RichTextBox1.Clear()
End Sub
Private Sub ToolStripButton21_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton21.Click
RichTextBox1.Undo()
End Sub
Private Sub ToolStripButton22_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton22.Click
RichTextBox1.Redo()
End Sub
Private Sub ToolStripButton52_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton52.Click
RichTextBox1.SelectionFont = New Font(RichTextBox1.SelectionFont.Name, RichTextBox1.SelectionFont.Size, FontStyle.Bold)
End Sub
Private Sub ToolStripButton31_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton31.Click
RichTextBox1.SelectionFont = New Font(RichTextBox1.SelectionFont.Name, RichTextBox1.SelectionFont.Size, FontStyle.Italic)
End Sub
Private Sub ToolStripButton53_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton53.Click
RichTextBox1.SelectionFont = New Font(RichTextBox1.SelectionFont.Name, RichTextBox1.SelectionFont.Size, FontStyle.Underline)
End Sub
Private Sub ToolStripButton26_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton26.Click
FontDialog1.ShowDialog()
RichTextBox1.Font = FontDialog1.Font
End Sub
Private Sub ToolStripButton27_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton27.Click
ColorDialog1.ShowDialog()
RichTextBox1.SelectionColor = ColorDialog1.Color
End Sub

Private Sub ToolStripButton64_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton64.Click
ColorDialog1.ShowDialog()
RichTextBox1.SelectionBackColor = ColorDialog1.Color
End Sub

Private Sub ToolStripButton29_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton29.Click
Dim sn, so As String
sn = RichTextBox1.SelectedText
so = LCase(sn)
RichTextBox1.SelectedText = so
End Sub

Private Sub ToolStripButton30_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton30.Click
Dim sp, sq As String
sp = RichTextBox1.SelectedText
sq = UCase(sp)
RichTextBox1.SelectedText = sq
End Sub

Private Sub ToolStripButton60_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton60.Click
RichTextBox1.SelectionFont = New Font(RichTextBox1.SelectionFont.OriginalFontName, RichTextBox1.SelectionFont.SizeInPoints, FontStyle.Strikeout)
End Sub

Private Sub ToolStripButton23_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton23.Click
RichTextBox1.SelectionAlignment = HorizontalAlignment.Left
End Sub

Private Sub ToolStripButton24_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton24.Click
RichTextBox1.SelectionAlignment = HorizontalAlignment.Right
End Sub

Private Sub ToolStripButton25_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton25.Click
RichTextBox1.SelectionAlignment = HorizontalAlignment.Center
End Sub

Private Sub ToolStripButton59_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton59.Click
Dim i As Integer
i = RichTextBox1.SelectionIndent
Try
If i < 250 Then
RichTextBox1.SelectionIndent = i + 7
Else
End If
Catch ex As Exception
End Try
End Sub

Private Sub ToolStripButton62_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton62.Click
Dim i As Integer
i = RichTextBox1.SelectionIndent
Try
If i > 7 Then
RichTextBox1.SelectionIndent = i - 7
Else
End If
Catch ex As Exception
End Try
End Sub

Private Sub ToolStripButton63_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton63.Click
RichTextBox1.SelectionBullet = True
RichTextBox1.SelectedRtf = RichTextBox1.SelectedRtf + ControlChars.Cr
RichTextBox1.SelectionIndent += 20
End Sub

Private Sub Schedular_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

End Sub
End Class

No comments: