Notepad Tutorial in Visual Basic .NET
Tags: VB.NET, VB 2008, VB 2010, VB 2012, VB 2013
Source code for this tutorial is available at the end of Page 4 of this tutorial
Open Visual Basic Express Edition.
Click on Project next to Create:
Click on Windows Form Application, and name the project "Your name Application" and then click Ok.
You can change the form text to "your name's notepad". Click on the form and then go to properties window, then change the text property.
Add a textbox from the Control box, and change it's property to multi line. To change the property click on the text box, and then click on the little arrow on the top right of the text box. You will see a new box, check MuliLine.
Once you check MultiLine, you will be able to resize the textbox, and therefore change the textbox size to fit the form from the left, right and bottom like this:
Change the text box anchor property to Top, Bottom, Left, Right. To do so, click on the text box, go to properties window, change the anchor property:
Click on the boxes that appear in gray as the image above.
This property will make the text box resize as the form resizes. For example, if the user want to maximize the form, the text box's size will also maximizes.
Add a MenuStrip from the control box, and place on top of the form between the form's control box, and the textbox.
Add File, Edit, Format, Help to the MenuStrip as follows:
Under File add New, Open, Save, and Exit as follows:
Note: for printing and print preview please click here
Under Edit add Undo, Cut, Copy, Paste, Select All and Find
Notice that we didn't add Redo because textbox control doesn't support it.
Under Format add Font, Text Color, Text Alignment, and Back Color.
Under Help add About