Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
と という 2 つの Windows フォームがForm1ありForm2ます。Form2のコントロールで、label1次のようなコードを使用して 2 つのフォーム間で値を渡そうとしています。
Form1
Form2
label1
Form2 frm = new Form2(); frm.label1.Text(); frm.ShowDialog();
しかし、次のエラー メッセージが表示されます。
「Form2.label1」は保護レベルのためアクセスできません
なぜこれが起こっているのか教えてください。