jeudi 6 septembre 2018

How to see if a checkbox is checked on another form? C#

I started a project on a gui to me any my friends but I can't figure out how to read a boolean from another form. This is that part of my code. Im really new to coding so I would really suggest (the one thats reading this) to ask a question what I should explain more. This code doesnt work but I have no idea why. Im doing a new settings called s and then I try to read a boolean from that but it doesnt work. Please leave the answer below.

// main form
 private void checkBox5_CheckedChanged(object sender, EventArgs e)
    {
        Settings s = new Settings();          
        {
            if(s.checkBox2.Checked)
            {
                Opacity = 0.9; //For an example

            }              
        }


// Settings form
private void checkBox2_CheckedChanged(object sender, EventArgs e)
    {

    }




Aucun commentaire:

Enregistrer un commentaire