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;

Edited 5 Years Ago by Singlem: n/a

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

This article has been dead for over six months. Start a new discussion instead.