Development of note pad
-
Upload
comstas -
Category
Engineering
-
view
71 -
download
0
Transcript of Development of note pad
![Page 1: Development of note pad](https://reader038.fdocuments.net/reader038/viewer/2022103105/587883c71a28ab466c8b68a1/html5/thumbnails/1.jpg)
Visual Programming 1
NOTEPAD APPLICATION DEVELOPMENT IN C#
Hamza Gulistan
![Page 2: Development of note pad](https://reader038.fdocuments.net/reader038/viewer/2022103105/587883c71a28ab466c8b68a1/html5/thumbnails/2.jpg)
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
![Page 3: Development of note pad](https://reader038.fdocuments.net/reader038/viewer/2022103105/587883c71a28ab466c8b68a1/html5/thumbnails/3.jpg)
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.
![Page 4: Development of note pad](https://reader038.fdocuments.net/reader038/viewer/2022103105/587883c71a28ab466c8b68a1/html5/thumbnails/4.jpg)
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
![Page 5: Development of note pad](https://reader038.fdocuments.net/reader038/viewer/2022103105/587883c71a28ab466c8b68a1/html5/thumbnails/5.jpg)
05/01/2023 Visual Programming 5
Dialogs
Doule Click and include the following Components in your form OpenFileDialog SaveFileDialog FontDialog ColorDialog Etc
![Page 6: Development of note pad](https://reader038.fdocuments.net/reader038/viewer/2022103105/587883c71a28ab466c8b68a1/html5/thumbnails/6.jpg)
05/01/2023 Visual Programming 6
After This, add the events and code and Learn it.
![Page 7: Development of note pad](https://reader038.fdocuments.net/reader038/viewer/2022103105/587883c71a28ab466c8b68a1/html5/thumbnails/7.jpg)
05/01/2023 Visual Programming 7
![Page 8: Development of note pad](https://reader038.fdocuments.net/reader038/viewer/2022103105/587883c71a28ab466c8b68a1/html5/thumbnails/8.jpg)
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; } }
![Page 9: Development of note pad](https://reader038.fdocuments.net/reader038/viewer/2022103105/587883c71a28ab466c8b68a1/html5/thumbnails/9.jpg)
05/01/2023 Visual Programming 9
![Page 10: Development of note pad](https://reader038.fdocuments.net/reader038/viewer/2022103105/587883c71a28ab466c8b68a1/html5/thumbnails/10.jpg)
05/01/2023 Visual Programming 10
![Page 11: Development of note pad](https://reader038.fdocuments.net/reader038/viewer/2022103105/587883c71a28ab466c8b68a1/html5/thumbnails/11.jpg)
05/01/2023 Visual Programming 11
Can learn for different ForeColor and BackColor too.
![Page 12: Development of note pad](https://reader038.fdocuments.net/reader038/viewer/2022103105/587883c71a28ab466c8b68a1/html5/thumbnails/12.jpg)
05/01/2023 Visual Programming 12
![Page 13: Development of note pad](https://reader038.fdocuments.net/reader038/viewer/2022103105/587883c71a28ab466c8b68a1/html5/thumbnails/13.jpg)
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; }
![Page 14: Development of note pad](https://reader038.fdocuments.net/reader038/viewer/2022103105/587883c71a28ab466c8b68a1/html5/thumbnails/14.jpg)
05/01/2023 Visual Programming 14
After This, Add the Code for Following as Learning
WordWrap PrintDialog PrintPreviewDialog
![Page 15: Development of note pad](https://reader038.fdocuments.net/reader038/viewer/2022103105/587883c71a28ab466c8b68a1/html5/thumbnails/15.jpg)
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