[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

selecting and de-selection of radio button in vb

Posted on 2004-10-27
8
Medium Priority
?
227 Views
Last Modified: 2010-04-17
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
Comment
Question by:subrata_das6478
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 13

Expert Comment

by:nurbek
ID: 12420636
If myradio.value Then
    myradio.value = False
Else
    myradio.value = True
End If
0
 
LVL 3

Accepted Solution

by:
stu_pb earned 136 total points
ID: 12421041
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
 
LVL 19

Assisted Solution

by:RanjeetRain
RanjeetRain earned 132 total points
ID: 12424254
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
 

Assisted Solution

by:Marc_Johnston
Marc_Johnston earned 132 total points
ID: 12424614
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
 
LVL 3

Expert Comment

by:stu_pb
ID: 12627778
I think dividing the points between RanjeetRain, Marc Johnston and myself is appropriate.

Thanks.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

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

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this post we will learn different types of Android Layout and some basics of an Android App.
Make the most of your online learning experience.
Simple Linear Regression
Six Sigma Control Plans

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question