Solved

Disable radio buttons

Posted on 2003-11-26
5
1,008 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
[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
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Update (December 2011): Since this article was published, the things have changed for good for Android native developers. The Sequoyah Project (http://www.eclipse.org/sequoyah/) automates most of the tasks discussed in this article. You can even fin…
Jaspersoft Studio is a plugin for Eclipse that lets you create reports from a datasource.  In this article, we'll go over creating a report from a default template and setting up a datasource that connects to your database.
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.

717 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