Results 1 to 4 of 4

Thread: [2.0] Checkbox

  1. #1

    Thread Starter
    Learning .Net danasegarane's Avatar
    Join Date
    Aug 2004
    Location
    VBForums
    Posts
    5,853

    [2.0] Checkbox

    Dear all,
    How to check a checkbox is checked or not.That is get the status of the checkbox
    Please mark you thread resolved using the Thread Tools as shown

  2. #2

  3. #3

    Thread Starter
    Learning .Net danasegarane's Avatar
    Join Date
    Aug 2004
    Location
    VBForums
    Posts
    5,853

    Re: [2.0] Checkbox

    Thanks BM,
    I have two groupbox.How to toggle the enabled property of the two group box with respect to the state of the checkbox.
    If the checkbox is checked,One groupbox should be enabled and one should be disabled and vice versa
    Please mark you thread resolved using the Thread Tools as shown

  4. #4
    Oi, fat-rag! bushmobile's Avatar
    Join Date
    Mar 2004
    Location
    on the poop deck
    Posts
    5,592

    Re: [2.0] Checkbox

    set groupBox2.Enabled = False at design time
    Code:
    private void checkBox1_CheckedChanged(object sender, EventArgs e)
    {
        groupBox1.Enabled = !checkBox1.Checked;
        groupBox2.Enabled = checkBox1.Checked;
    }
    or, being obtuse:
    Code:
    private void checkBox1_CheckedChanged(object sender, EventArgs e)
    {
        groupBox1.Enabled = !(groupBox2.Enabled = checkBox1.Checked);
    }

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width