Question:
How do I get radio buttons in Visual Studio 2008 to have only one selection at a time?
scottman895
2010-04-10 18:42:04 UTC
This is for a project. I am having difficulty trying to get two radio buttons (Example: Choosing Male or Female for Gender in a form) to work properly where if you click on one button, the other was is no longer checked. The buttons are displayed horizontally in the form and they are radio buttons, not radio button lists. This is all in Microsoft Visual Studio 2008 using ASP.NET (.aspx format) for the web pages with Visual Basic (NOT VBScript) as the background code. Is there any way the radio buttons to work properly?
Four answers:
Ratchetr
2010-04-10 19:03:51 UTC
Set the GroupName property for each radio button to have the same name.

Doesn't matter what the name is, as long as it is unique for each group. Gender would be a reasonable choice.

You'll find GroupName in the properties for the radio buttons.
?
2016-11-06 11:06:06 UTC
Visual Studio Radio Button
kataruna
2010-04-10 23:26:37 UTC
There is a practical way for that. In the toolbox find "groupbox" control and drag it to your form. Adjust it however you like. And then place the radiobuttons inside that groupbox. That's all. When one of these radiobuttons is checked, others will be unchecked.



Happy programming!
?
2016-12-11 13:40:08 UTC
there's a sensible way for that. contained in the toolbox discover "groupbox" administration and drag it for your type. regulate it in spite of the undeniable fact that you want. and then position the radiobuttons interior that groupbox. that's all. even as this way of radiobuttons is checked, others will be unchecked. chuffed programming!


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...