⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 newfileform.cs

📁 在CSharpNotepad中可以创建和编辑简单文本文档
💻 CS
字号:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace CSharpNotepad
{
    public partial class newfileForm : Form
    {
        private mainForm _Owner;    //标记该子窗口的父窗口

        public newfileForm()
        {
            InitializeComponent();
        }

        public newfileForm(mainForm _Parent)
        {
            InitializeComponent();

            _Owner = _Parent;   //设置该子窗口的父窗口
        }

        private void listBox1_DoubleClick(object sender, EventArgs e)
        {
            if (listBox1.SelectedIndex == 0)
            {
                _Owner.newfileType = ".rtf";
            }
            else if (listBox1.SelectedIndex == 1)
            {
                _Owner.newfileType = ".txt";
            }
            this.Close();
        }

        private void okButton_Click(object sender, EventArgs e)
        {
            if (listBox1.SelectedIndex == 0)
            {
                _Owner.newfileType = ".rtf";
            }
            else if (listBox1.SelectedIndex == 1)
            {
                _Owner.newfileType = ".txt";
            }
            this.Close();
        }

        private void cancelButton_Click(object sender, EventArgs e)
        {
            _Owner.newfileType = "null";
            this.Close();
        }
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -