Public Class Form1

    Private Sub 結束ToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles 結束ToolStripMenuItem.Click
        End
    End Sub

    Private Sub ToolStripMenuItem2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripMenuItem2.Click
        RichTextBox1.SelectionFont = New Font("新細明體", 12, RichTextBox1.SelectionFont.Style)
    End Sub

    Private Sub ToolStripMenuItem3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripMenuItem3.Click
        RichTextBox1.SelectionFont = New Font("新細明體", 20, RichTextBox1.SelectionFont.Style)
    End Sub

    Private Sub ToolStripMenuItem4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripMenuItem4.Click
        RichTextBox1.SelectionFont = New Font("新細明體", 30, RichTextBox1.SelectionFont.Style)
    End Sub

    Private Sub ToolStripButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton1.Click
        RichTextBox1.SelectionFont = New Font("新細明體", RichTextBox1.SelectionFont.Size, RichTextBox1.SelectionFont.Style Or FontStyle.Bold)
    End Sub

    Private Sub ToolStripButton2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton2.Click
        RichTextBox1.SelectionFont = New Font("新細明體", RichTextBox1.SelectionFont.Size, RichTextBox1.SelectionFont.Style Or FontStyle.Italic)
    End Sub

    Private Sub ToolStripButton3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton3.Click
        RichTextBox1.SelectionFont = New Font("新細明體", RichTextBox1.SelectionFont.Size, RichTextBox1.SelectionFont.Style Or FontStyle.Underline)
    End Sub

    Private Sub 開啟舊檔ToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles 開啟舊檔ToolStripMenuItem.Click
        OpenFileDialog1.Filter = "文字檔案(*.txt)|*.txt"
        If OpenFileDialog1.ShowDialog = DialogResult.OK Then
            RichTextBox1.Text = My.Computer.FileSystem.ReadAllText(OpenFileDialog1.FileName)
        End If
        儲存檔案ToolStripMenuItem.Enabled = True
    End Sub

    Private Sub 儲存檔案ToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles 儲存檔案ToolStripMenuItem.Click
        My.Computer.FileSystem.WriteAllText(OpenFileDialog1.FileName, RichTextBox1.Text, False)
    End Sub
End Class
