How to create NotePad Text Editor using C-Sharp| Dot-Net Development.


Notepad is a simple text editor for Microsoft windows, and a basic text editing program that enables the user to create documents. In this Article we will learn about how to create notepad text editor using C# programming language,and in Visual Studio which is the Integrated Development Environment. First All Open blank Windows Form app in Visual Studio , Lets Started :

STEP NO. : 01 (TextBox Setting)

- Pick texBox from the toolBox and placed on your form , Now in the properties of TextBox find "MultiLine" property and select it "True", now find Dock in the textBox properties and Select it as "fill".

STEP NO. : 02 (MenuStrip Setting)

- Now, pick menuStrip from the toolBox and placed on your form, when you placed it, it will apear on top of your form, you can see there "typehere" now type these thing as shown in below picture:
Now, Click on first option named "File" and give it sub menus like "New, Open , Save , Save as and Exit " options.
When you click on "File" it will automatically appears the option of submenus now give it names, after Giving the options it will look like this:





 STEP NO. : 03 (DialogueBoxes)

- Now, Pick OpenFileDialogue, SaveDialogueBox, FontDialogue and ColorDialogue from the toolBox and placed on your form, when you placed on your form it will appears at the lower of your window :

STEP NO. : 05 (Open New Page By clicking On New)

- Now, Click on FileMenusStrip and double Click on submenu named "New" and do this coding on this menu, you will see an event look like this :

inside this event do this coding:
 textBox1.Text = "";

STEP NO. : 06 (Open the saved file by clicking on Open)

- Now, double click on submenu named "Open", and inside the event do this coding :
{
openFileDialog1.ShowDialog();
            string a = openFileDialog1.FileName;
            textBox1.Text=System.IO.File.ReadAllText(a);
  }       

STEP NO. : 07 (Save your file By clicking on Save)

- Now, double click on submenu name "Save as" and inside the event do this coding:
{
            saveFileDialog1.ShowDialog();
            string fileName = saveFileDialog1.FileName;
            System.IO.File.AppendAllText(fileName + ".txt", textBox1.Text);

        }

STEP NO. : 08 (Exit your File by clicking on Exit)

Now, click on submenu named "Exit" and inside the event do this coding:
{
            Application.Exit();
        }

after the file execution when you click on exit it will close the application.

STEP NO. : 09 (Font Size, Style changed by clicking of Font)

- Click on formatMenuStrip and then from the submenus of FomatMenuStrip double click on "Font" and inside the event do this coding:
{
            fontDialog1.ShowDialog();
            Font f = fontDialog1.Font;
            textBox1.Font = f;
        }

by doing this, after execution of file you can change font style, increase or decrease font size of textBox and you can do everything here as you do in notepad.

STEP NO. : 10 (Change Font Color by clicking on text color)

- Double click on Text Color and inside the event do this coding :
 {
            colorDialog1.ShowDialog();
            Color FontColor = colorDialog1.Color;
            textBox1.ForeColor = FontColor;
        }
By doing this , a color dialogue box will appear after the execution of program you can choose your favourite color and then click on ok it will changed the color of text.


STEP NO. : 11 (Change the background color of Notepad)

- Double click on the background color in the sub menus of format and inside the event do this coding:

{
            colorDialog1.ShowDialog();
            Color BackColor = colorDialog1.Color;
            textBox1.BackColor = BackColor;
        }


Notepad has almost completed, now we have to add the feature of shortcut Keys , so for the shortcut keys go to select the options of menustrip and go to properties and find shortcut keys and then open it and choose as you want :


Now , press Ctrl + F5 and run Your program , it will work same as Notepad, some pictures of our own Notepad are:

Simple Text

Font Dialogue Box for changing the font style






After clicking on Font dialogue box the font will look like this.

Font Color changing dialogueBox.


After Clicking Ok on FontColor Dialogue Box

Background color changing from the backgroudcolor option.



This is our Notepad file which we have created in visual studio windows form app using C-Sharp Language, Hope you like it , Thank You!
How to create NotePad Text Editor using C-Sharp| Dot-Net Development. How to create NotePad Text Editor using C-Sharp| Dot-Net Development. Reviewed by Developer Planet on October 18, 2018 Rating: 5

1 comment:

  1. How To Create Notepad Text Editor Using C-Sharp >>>>> Download Now

    >>>>> Download Full

    How To Create Notepad Text Editor Using C-Sharp >>>>> Download LINK

    >>>>> Download Now

    How To Create Notepad Text Editor Using C-Sharp >>>>> Download Full

    >>>>> Download LINK

    ReplyDelete

Advertising

Powered by Blogger.