We have created an Application called MyNotes with a rich text box, a menu with standard items, and a toolstrip. The rich text box fills the form.
Next we will write the code to implement New. The is a corresponding button on the toolbar and we will write one sub to handle both events.
Private Sub NewToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) _
Handles NewToolStripMenuItem.Click, NewToolStripButton.Click
RichTextBox1.Text = "" 'Erases the text in the RichTextBox
Me.Text = "Untitled"
OpenFileDialog1.FileName = "" 'If the user clicks save we want to show the SaveFileDialog
What is missing at this point is the implementation checking that the file has been saved when we close the program. This is similar to what we did with the ToDo list.