• Winform 记事本


    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Windows.Forms;
    
    namespace 菜单控件
    {
        public partial class Form1 : Form
        {
            public Form1()
            {
                InitializeComponent();
            }
    
            private void 退出XToolStripMenuItem_Click(object sender, EventArgs e)
            {
                this.Close();//鼠标点击实现退出
            }
    
            private void 撤消UToolStripMenuItem_Click(object sender, EventArgs e)
            {
                textBox1.Undo();//鼠标点击实现输入文字的撤销
            }
    
            private void 剪切TToolStripMenuItem_Click(object sender, EventArgs e)
            {
                textBox1.Cut();//鼠标点击实现文字剪切
            }
    
            private void 复制CToolStripMenuItem_Click(object sender, EventArgs e)
            {
                textBox1.Copy();//鼠标点击实现文字复制
            }
    
            private void 粘贴PToolStripMenuItem_Click(object sender, EventArgs e)
            {
                textBox1.Paste();//鼠标点击实现文字粘贴
            }
    
            private void 全选AToolStripMenuItem_Click(object sender, EventArgs e)
            {
                textBox1.SelectAll();//鼠标点击实现文字全选
            }
    
            private void textBox1_TextChanged(object sender, EventArgs e)
            {
                string s = textBox1.TextLength.ToString();//记录并显示字符的数量,先将这个记事本文本的长度以字符串的形式赋值到变量s中
                toolStripStatusLabel2.Text = s;//底部菜单栏文本控件文本的值等于记事本文本的长度
            }
        }
    }
  • 相关阅读:
    linux 学习笔记
    linux 子系统折腾记 (三)
    linux子系统折腾记 (二)
    windows linux 子系统折腾记
    会计学习笔记(非专业)
    linux 大冒险
    coreRT 和 Native 编译netcore AOT程序
    dotnet core如何编译exe
    win10的hyper-v共享文件夹
    packagereference 里面的资产是怎么回事?
  • 原文地址:https://www.cnblogs.com/suiyuejinghao123/p/5628680.html
Copyright © 2020-2023  润新知