vendredi 11 août 2017

How do you save a setting for showing a form in C#?

i'm creating two forms in C#; one is the startup form, and the other one is the main form. I want to give a setting in the main form with a Checkbox, and i want it to show the startup form when it is checked. And when it is not, it will not show the startup form and continue directly to the main form. Here's the screenshot i've provided regarding the setting i've made:

Here's the code i've managed to make so far :C

private void checkBox4_CheckedChanged(object sender, EventArgs e)
    {
        if (checkBox4.Checked == true)
        {
            Startup s = new Startup();
            s.Visible = true;
        }
        if (checkBox4.Checked == false)
        {
            Startup s = new Startup();
            s.Visible = false;
        }
    }

Can anyone please help. thanks.




Aucun commentaire:

Enregistrer un commentaire