Step 2
Now drag and drop the MenuStrip from the control window and add the required menu items and their icons.We can add menu strip directly by drag and drop or at run time. The Menustrip control is new to this version of Visual Studio and the .NET Framework.With the help of Menustrip ,you can easily create menus like those found in Microsoft Office.
Step3
Drag and drop the Rich Textbox from the toolbox in the form.Set the dock property as fill .so that the size of Rich Textbox is changed according with size of the form.By using the Richtextbox control,user can enter and edit the text.The Control provide advanced Feature than normal Textbox contol.
Form look like as,
Step 4
Drag and drop the Context Menustrip from the toolbox in the form.Context menu can be used with any control,right clicking he mouse shows the shortcut menu.Here ContextMenuStrip assosiated with the Rich Textbox control for the purpose of copy,paste,undo,Redo etc
Step 5
Code for Context Menu strip as shown in the screenshot given below,
Now Compile and Run the following Output appear as shown in the screenshot given below.We can able to copy,Paste,Undo and Redo the Text in Notepad
Step 6
Now we discuss the code for Open Function.The openfiledialog control is used in the code.The main Function of Openfiledialog control use to browse data from the computer. So whenever the open option is clicked it will browse Data from the Computer and displays the selected file in notepad.
Now Compile and Run ,the following Output appear as shown in the screenshot given below.We can able to Open the file from the computer in Notepad.
Step 7
Now we discuss the code for SaveFunction.The savefiledialog control is used in the code.The main Function of savefiledialog control allow the user to save a file by specific name at Specific Location and type. So whenever the Save option is clicked it will Save File to the Computer.
Now Compile and Run, the following Output appear as shown in the screenshot given below.We can able to Save the file to the computer.
Summary
Hope this article is usefull for creating Notepad in Visual Studio 2017 ,Thanks for reading my article.