在主mdi窗口中设置

		text f2 = new shiyan3.text();
		//设置为public可访问
        public void 打开文本ToolStripMenuItem1_Click(object sender, EventArgs e)
        {
           
            f2.MdiParent = this;
            f2.Show();
            toolStripStatusLabel1.Text = "已打开文本";
        }
       
        public void toolStripLabel2_Click(object sender, EventArgs e)
        {
              f2.textBox1.Font = new Font("黑体", 25, FontStyle.Bold);
        }

        private void toolStripLabel3_Click(object sender, EventArgs e)
        {
            f2.textBox1.Text = f2.textBox1.Text + Clipboard.GetData(DataFormats.Text).ToString();
        }

然后在需要使用的控件中的属性 modifier中选择public
这边选择的就是textBox1的属性
C#如何解决 MDI使用子窗口空间出现“不可访问,因为它受保护级别限制”
然后即可使用,不会再出现以下错误
C#如何解决 MDI使用子窗口空间出现“不可访问,因为它受保护级别限制”

相关文章:

  • 2021-05-20
  • 2021-12-10
  • 2021-11-15
  • 2022-02-13
  • 2022-01-27
  • 2021-12-04
猜你喜欢
  • 2021-11-04
  • 2021-11-18
  • 2022-12-23
  • 2021-10-14
  • 2021-07-17
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案