dimanche 17 octobre 2021

'Form.checkBox1' is inaccessible due to its protection level

I am trying to get a checkbox's state and apply that to another checkbox on a different form but I get this error:

'Form.checkBox1' is inaccessible due to its protection level

My code is:

Form1 f1 = new BananaWare();
            f1.checkBox1.Checked = !checkBox1.Checked;
            f1.Show();

How do I fix this error?




Aucun commentaire:

Enregistrer un commentaire