textBox1
メインフォームにあるコントロールが 1 つありますForm1
。textBox1
別のクラスのテキストを変更できるようにしたいのですが、another_class
できません。私には、次のようにして処理another_class
するイベントがありますteacher
Form1
private void button1_Click(object sender, EventArgs e)
{
another_class myNew_another_class = new another_class();
myNew_another_class.teacher(sender, e);
}
したがってanother_class
、上記のハンドラーを混乱させて赤いタグを付けてしまうため 、以下を作成することはできません
public another_class (Form1 anytext_Form)
{
this.anytext_Form = anytext_Form;
}