none
Radio button deselect/ uncheck

    Question

  • I'm using VS 2005 C# windows app - I have a radio button and i want to give the ability to the user to uncheck the radio button. Note: the radio buttons are added dynamically into the form.

    Please help

    Thanks

    Monday, May 24, 2010 11:16 AM

Answers

  • use a checkbox and uncheck the other checkboxes on CheckedChanged event if there is other options.
    Mahmoud Darwish Senior Software Developer C#/VB
    • Marked as answer by Liliane Teng Monday, May 31, 2010 10:32 AM
    Monday, May 24, 2010 11:22 AM
  • Radio buttons are best used when one choice only should be made from a list.

    Use check boxes when one or more items could be selected. 

    There should never be a need to uncheck a radio button.

    • Marked as answer by Liliane Teng Monday, May 31, 2010 10:32 AM
    Monday, May 24, 2010 12:00 PM
  • Hello Shunmug,
    Thanks for your post.
    I agree with the above replies. You could try checkbox for better implementation. CheckBox controls let the user pick a combination of options or non option. In contrast, RadioButton controls allow a user to choose from mutually exclusive options.

    More information about checkbox:
    http://msdn.microsoft.com/en-us/library/system.windows.forms.checkbox.aspx
    Best regards,
    Liliane


    Please mark the replies as answers if they help and unmark them if they provide no help. Thanks
    • Marked as answer by Liliane Teng Monday, May 31, 2010 10:32 AM
    Monday, May 31, 2010 10:03 AM

All replies

  • use a checkbox and uncheck the other checkboxes on CheckedChanged event if there is other options.
    Mahmoud Darwish Senior Software Developer C#/VB
    • Marked as answer by Liliane Teng Monday, May 31, 2010 10:32 AM
    Monday, May 24, 2010 11:22 AM
  • Radio buttons are best used when one choice only should be made from a list.

    Use check boxes when one or more items could be selected. 

    There should never be a need to uncheck a radio button.

    • Marked as answer by Liliane Teng Monday, May 31, 2010 10:32 AM
    Monday, May 24, 2010 12:00 PM
  • Throw a checkbox on the form and put in the following code:
     if (cheeckbox1.Checked == true)
       {
        radiobutton.Enabled = false;
       }

    My .NET Blog: http://michaelcrump.net
    Monday, May 24, 2010 4:22 PM
  • Hello Shunmug,
    Thanks for your post.
    I agree with the above replies. You could try checkbox for better implementation. CheckBox controls let the user pick a combination of options or non option. In contrast, RadioButton controls allow a user to choose from mutually exclusive options.

    More information about checkbox:
    http://msdn.microsoft.com/en-us/library/system.windows.forms.checkbox.aspx
    Best regards,
    Liliane


    Please mark the replies as answers if they help and unmark them if they provide no help. Thanks
    • Marked as answer by Liliane Teng Monday, May 31, 2010 10:32 AM
    Monday, May 31, 2010 10:03 AM
  •  Just change ur radio buttons Auto check property to false and create a click event for those radio buttons.

    In the click event do as follow

    radioButton_Click(object sender, EventArgs e)
    {
    
    if(radioButton.Checked == true)
    
    radioButton.Checked = false
    
    else
    
    radioButton.Checked = true
    
    }

    So the user can uncheck the radio button by clicking it....

     

    Thanks,

    Karguvel

    Monday, May 31, 2010 10:32 AM
  • I Find the Solution for uncheck the radio button while form load

    The Code is::

     private void fForm_Load(object sender, EventArgs e)
            {

                radioButton1.AutoCheck = false;
                radioButton2.AutoCheck = false;

    }

    Try Some thing Like this.  Thanks Happy Coding.........?

    Tuesday, April 24, 2012 3:21 PM