Solved

Disable radio buttons

Posted on 2003-11-26
5
977 Views
Last Modified: 2013-12-26
How to make one of the radio button disable and other should be enable.
0
Comment
Question by:tneelu3
5 Comments
 
LVL 5

Accepted Solution

by:
gafoor78 earned 20 total points
ID: 9826352
Just use the enabled property of the radio button

eg: script

  rb_1.enabled = true
  rb_2.enabled = false

 and if u want to check the enabled radiobutton then
 rb_1.checked = true

rgrds
gafoor
0
 
LVL 8

Expert Comment

by:gajender_99
ID: 9830591
i think you want to check which one is checked because if you click on the frst one then the other one would be desabled if you use the nable command and then you wont be able to click on the disable radio button

if its the matter of checked then you can write this script

clicked event for rb_1
if this.checked=true then
rb_2.checked=False
End if

clicked event for rb_2
if this.checked=true then
rb_1.checked=False
End if

0
 

Expert Comment

by:gs576
ID: 12960757
Hi,
a)   A simple way is that u can take the 2 radio buttons in a group box and in the properties of one of the radio button select the checked option. So at any point of the time only one radio button will be enabled while the othere will be disabled. But u can enable the other radio button and when u do so the first one will get disabled.

b)  If u do not want to put the radio buttons in a a group box:
Set one of the radio buttons as checked in the properties.
Assune there are rb_1 & rb_2
clicked event of rb_1
rb_2.checked = false
rb_1.checked = true

clicked event of rb_2
rb_2.checked = true
rb_1.checked = false


0

Featured Post

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

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

Suggested Solutions

In our object-oriented world the class is a minimal unit, a brick for constructing our applications. It is an abstraction and we know well how to use it. In well-designed software we are not usually interested in knowing how objects look in memory. …
Programmer's Notepad is, one of the best free text editing tools available, simply because the developers appear to have second-guessed every weird problem or issue a programmer is likely to run into. One of these problems is selecting and deleti…
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.
The viewer will learn how to use and create new code templates in NetBeans IDE 8.0 for Windows.

803 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