CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2006
    Posts
    392

    [RESOLVED] Checkbox

    Dear all,
    How to check a checkbox is checked or not.That is get the status of the checkbox.And alos 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 .How do i?
    Last edited by danasegarane; February 4th, 2007 at 07:31 AM.
    VS 2005

  2. #2
    Join Date
    Jan 2007
    Posts
    491

    Re: Checkbox

    There is Checkbox properties called "Checked", if its value is false the Checkbox is unchecked, and so vice versa.

    Also, there's a event of the Checkbox that execute when the propertie "Checked" changes. (Means when the user click on the Checkbox). you can use this event and check there expressions (and response accordingly). For example:
    Code:
            private void checkBox1_CheckedChanged(object sender, EventArgs e)
            {
                if (checkBox1.Checked == true)
                {
                    group1.Enabled = true;
                    group2.Enabled = false;
                }
                else
                {
                    group1.Enabled = false;
                    group2.Enabled = true;
                }
            }

  3. #3
    Join Date
    Sep 2006
    Location
    Eastern, NC, USA
    Posts
    907

    Re: Checkbox

    couldn't have said it better

  4. #4
    Join Date
    Sep 2006
    Posts
    392

    Re: Checkbox

    Thanks you
    VS 2005

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

Featured