development of note pad
TRANSCRIPT
Visual Programming 1
NOTEPAD APPLICATION DEVELOPMENT IN C#
Hamza Gulistan
05/01/2023 Visual Programming 2
start1. open your visual c# 2008/2010/2012/2015
2.create a new project and name it NotePad or better UrFirstName_NotePad
3.edit form properties like text as “NotePad” and name it as frmNotePad
4. now go to toolbox and grab richTextBox control inside the form and name it as rtb_NotePad
05/01/2023 Visual Programming 3
Dock What is Dock? What should be dock for the
rtb_NotePad? And why?
Add MenuStrip1 and name it as mnuNotePad
And then create the menuStrip items as given in next slide.
MenuItems
Edit Cut Copy Paste - DateT
ime Select
All - Undo Redo
05/01/2023 Visual Programming 4
O FileO New O Ope
nO SaveO -O Exit
O FormatO wordWra
p O FontO Color
O ViewO StatusBarO -O CentreO LeftO Right
O AboutO AboutUs
05/01/2023 Visual Programming 5
Dialogs
Doule Click and include the following Components in your form OpenFileDialog SaveFileDialog FontDialog ColorDialog Etc
05/01/2023 Visual Programming 6
After This, add the events and code and Learn it.
05/01/2023 Visual Programming 7
05/01/2023 Visual Programming 8
saveprivate void saveToolStripMenuItem_Click(object sender, EventArgs e) { dlg_save.Title = "Save As"; dlg_save.Filter = "Text Document|*.txt";//applied filter dlg_save.DefaultExt = "txt";//applied default extension if (dlg_save.ShowDialog() == DialogResult.OK) { rtb_NotePad.SaveFile(dlg_save.FileName, RichTextBoxStreamType.PlainText); this.Text = dlg_save.FileName; } }
05/01/2023 Visual Programming 9
05/01/2023 Visual Programming 10
05/01/2023 Visual Programming 11
Can learn for different ForeColor and BackColor too.
05/01/2023 Visual Programming 12
05/01/2023 Visual Programming 13
Add the Alignment Code for Centre, Left and Right separately
private void centreToolStripMenuItem_Click(object sender, EventArgs e) { rtb_NotePad.SelectionAlignment = HorizontalAlignment.Center; }
05/01/2023 Visual Programming 14
After This, Add the Code for Following as Learning
WordWrap PrintDialog PrintPreviewDialog
05/01/2023 Visual Programming 15
Want to learn More , Explore The following Links
https://msdn.microsoft.com/en-us/library/aa972157(v=vs.90).aspxhttp://www.c-sharpcorner.com/uploadfile/rajshree.mittal/notepad-in-C-Sharp/http://www.codeproject.com/Questions/231201/How-to-make-Notepad-using-Csharp