Solved

Disable radio buttons

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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone 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

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…
Here is a helpful source code for C++ Builder programmers that allows you to manage and manipulate HTML content from C++ code, while also handling HTML events like onclick, onmouseover, ... Some objects defined and used in this source include: …
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 and create new code templates in NetBeans IDE 8.0 for Windows.

808 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