Simple function Making of Notepad

Source: Internet
Author: User

First Use the menu and toolbar controls, Notepad's tool menu bar directly with the MenuStrip control, and then right-select Insert Standard items, simple menu bar function button will be automatically added,

Add a bottom toolbar with Statustrip, which can place multiple controls such as a text drop-down menu, add two controls that display text, and use it as a record to display the number of characters in Notepad.

Currently, only the functions and exits in the Edit drop-down list are implemented.

usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Data;usingSystem.Drawing;usingSystem.Linq;usingSystem.Text;usingSystem.Windows.Forms;namespaceMenu Control { Public Partial classForm1:form { PublicForm1 () {InitializeComponent (); }        Private voidExit Xtoolstripmenuitem_click (Objectsender, EventArgs e) {             This. Close ();//mouse Click to implement the Exit        }        Private voidUndo Utoolstripmenuitem_click (Objectsender, EventArgs e) {Textbox1.undo ();//mouse Click to implement the input text revocation        }        Private voidShear Ttoolstripmenuitem_click (Objectsender, EventArgs e) {textbox1.cut ();//mouse click to achieve text cut        }        Private voidCopy Ctoolstripmenuitem_click (Objectsender, EventArgs e) {textbox1.copy ();//mouse click to achieve text copy        }        Private voidPaste Ptoolstripmenuitem_click (Objectsender, EventArgs e) {textbox1.paste ();//mouse click to implement text pasting        }        Private voidSelect All Atoolstripmenuitem_click (Objectsender, EventArgs e) {Textbox1.selectall ();//mouse Click to achieve the full selection of text        }        Private voidtextBox1_TextChanged (Objectsender, EventArgs e) {            strings =textBox1.TextLength.ToString (); //record and display the number of characters, first assign the length of the Notepad text to the variable s in the form of a string Toolstripstatuslabel2.text=s;    //Bottom menu bar text control text value equals the length of the Notepad text } }}

Simple function Making of Notepad

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.