我希望能够直接访问另一个窗体中文本框内的文本,因此我向一个窗体添加了一个公共变量_txt,并添加了以下事件:
但是表单是这样加载的:
有没有更好的方法直接链接这两个内容?
private void richTextBox1_TextChanged(object sender, EventArgs e)
{
_txt = richTextBox1.Text;
}
但是表单是这样加载的:
public FrmTextChild(string text)
{
InitializeComponent();
_txt = text;
richTextBox1.Text = _txt;
Text = "Untitled.txt";
}
有没有更好的方法直接链接这两个内容?