예제 #1
0
        private void 新建ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Class3ChildForm chd = new Class3ChildForm();

            chd.MdiParent = this;
            chd.Show();
        }
예제 #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;
            }
        }
예제 #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;
            }
        }
예제 #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;
            }
        }
예제 #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;
            }
        }
예제 #6
0
        private void 剪切ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Class3ChildForm childForm = (Class3ChildForm)this.ActiveMdiChild;

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

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

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