[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 228
  • Last Modified:

selecting and de-selection of radio button in vb

I want to make the radio button as toggle button. means when i selects that first time and select it second time it should be de-selected on clicking it.
Pls provide code in VB
its urgent!!!
0
subrata_das6478
Asked:
subrata_das6478
3 Solutions
 
nurbekCommented:
If myradio.value Then
    myradio.value = False
Else
    myradio.value = True
End If
0
 
stu_pbCommented:
In this case, why not use a checkbox.  Radio buttons are used when one item must always be selected, checkboxes are used to toggle an on/off state.

If you have a few items where only one can be selected or none can be selected you could use checkboxes, then in the OnClick handler of each checkbox, you can turn off the other checkboxes using checkbox2.value = false and so on.

Good luck,
0
 
RanjeetRainCommented:
Not possible. By definition, a radio set is a "one of many" choice. Once you have selected it, you can unselect it. They only workaround can be to your checkboxes.
0
 
Marc_JohnstonCommented:
Again not possible.  VB automatically turns on the radio button that is clicked.  There are no events that occur AFTER the radio button has been turned on automatically to allow you to turn it off.  The best solution is to simple add another radio button selection for the Off option.
0
 
stu_pbCommented:
I think dividing the points between RanjeetRain, Marc Johnston and myself is appropriate.

Thanks.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now