Solved

Disable radio buttons

Posted on 2003-11-26
5
957 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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

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. …
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…
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…
THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.

758 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now