Dear Friends,

I have 5 check box and one submit button::


my problem is while checking first check box up to fifth check box is checked then i want to enter to form 2

i want that small code to check the check boxes,it may be in switch or if condition

Dear Friends,

I have 2 check box and one submit button::


my problem is while checking first check box 1 and check box2 is checked then i want to enter to form 2 while clicking the submit button

i want that small code to check the check boxes,it may be in switch or if condition

my vision is

checkbox1::age above 18


check box2::agree with our terms and service

submit button

if the above two is checked enter to next form else display message you are not accepting our terms.

Nb::no need of database connecting,it will check itself in form

private void submitbutton_Click(object sender, EventArgs e)
{
    if (checkbox1.checked && checkbox2.checked)
    {
        Form2 Form = new Form2();
        Form.Show();
        this.Hide();
    }
    else
    {
        MessageBox.Show("You are not accepting our terms.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
    }
}

I just don't understand what you want with this
"Nb::no need of database connecting,it will check itself in form "

But you can use

checkbox1.checked = true;

if (checkBox1.Checked && checkBox2.Checked)

why capital letter i dont know if you know it reply to me

this is worked for me thanks a great is it for radio button,please reply

please one more help i want to exit that application Application.Exit, while click ok

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.