Ejemplo n.º 1
0
        private void 新建ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Class3ChildForm chd = new Class3ChildForm();

            chd.MdiParent = this;
            chd.Show();
        }
Ejemplo n.º 2
0
        private void 字体ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FontDialog fontDialog = new FontDialog();

            if (fontDialog.ShowDialog() == DialogResult.OK)
            {
                Class3ChildForm childForm = (Class3ChildForm)this.ActiveMdiChild;
                childForm.richTextBox1.SelectionFont = fontDialog.Font;
            }
        }
Ejemplo n.º 3
0
        private void 颜色ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ColorDialog colorDialog = new ColorDialog();

            if (colorDialog.ShowDialog() == DialogResult.OK)
            {
                Class3ChildForm childForm = (Class3ChildForm)this.ActiveMdiChild;
                childForm.richTextBox1.SelectionColor = colorDialog.Color;
            }
        }
Ejemplo n.º 4
0
        private void 打开ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            OpenFileDialog openFileDialog = new OpenFileDialog();

            openFileDialog.Filter = "富文本文件(*.ustb)|*.ustb";
            if (openFileDialog.ShowDialog() == DialogResult.OK)
            {
                Class3ChildForm childForm = new Class3ChildForm();
                childForm.MdiParent = this;
                childForm.Show();
                childForm.richTextBox1.LoadFile(openFileDialog.FileName);
                childForm.filePath = openFileDialog.FileName;
            }
        }
Ejemplo n.º 5
0
        private void 另存为ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            SaveFileDialog fileDialog = new SaveFileDialog();

            fileDialog.Filter       = "富文本文件(*.ustb)|*.ustb"; //设置文件类型
            fileDialog.FileName     = "富文本文件";                //设置默认文件名
            fileDialog.DefaultExt   = "ustb";                 //设置默认格式(可以不设)
            fileDialog.AddExtension = true;                   //设置自动在文件名中添加扩展名
            if (fileDialog.ShowDialog() == DialogResult.OK)
            {
                Class3ChildForm childForm = (Class3ChildForm)this.ActiveMdiChild;
                childForm.richTextBox1.SaveFile(fileDialog.FileName);
                childForm.filePath = fileDialog.FileName;
            }
        }
Ejemplo n.º 6
0
        private void 剪切ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Class3ChildForm childForm = (Class3ChildForm)this.ActiveMdiChild;

            childForm.richTextBox1.Cut();
        }
Ejemplo n.º 7
0
        private void 保存ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Class3ChildForm childForm = (Class3ChildForm)this.ActiveMdiChild;

            childForm.richTextBox1.SaveFile(childForm.filePath);
        }
Ejemplo n.º 8
0
        private void 冬ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Class3ChildForm childForm = (Class3ChildForm)this.ActiveMdiChild;

            childForm.richTextBox1.BackColor = Color.FromArgb(255, 255, 255, 255);
        }