473,395 Members | 1,496 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

enabling\disabling a radiobutton

I have several radio buttons for the user to choose from. I need to enable
or disable a particular radio button, depending on a certain condition.

How can I do this?

Thanks, Leonard
Sep 30 '05 #1
6 10835
Hi Leonard,

I'm not sure what you mean. Unless you simply are looking for the Enabled property. Set the Enabled property to false for the RadioButton in question when you test the condition.
On Fri, 30 Sep 2005 16:47:06 +0200, Leonard <Le*****@discussions.microsoft.com> wrote:
I have several radio buttons for the user to choose from. I need to enable
or disable a particular radio button, depending on a certain condition.

How can I do this?

Thanks, Leonard


--
Happy coding!
Morten Wennevik [C# MVP]
Sep 30 '05 #2
Sorry, I should have been more clear. I don't want to disable all of the
radio buttons in the group, only a single one in the collection.

"Morten Wennevik" wrote:
Hi Leonard,

I'm not sure what you mean. Unless you simply are looking for the Enabled property. Set the Enabled property to false for the RadioButton in question when you test the condition.
On Fri, 30 Sep 2005 16:47:06 +0200, Leonard <Le*****@discussions.microsoft.com> wrote:
I have several radio buttons for the user to choose from. I need to enable
or disable a particular radio button, depending on a certain condition.

How can I do this?

Thanks, Leonard


--
Happy coding!
Morten Wennevik [C# MVP]

Sep 30 '05 #3
kea
As Morten says, you just disable the specific radiobutton. F.x. if we
have 3 radiobuttons (rb1, rb2, rb3) in a groupbox (grp_radiobuttons)
and you want to disable rb2, then you just write rb2.enabled = false.

Sep 30 '05 #4
I apologize. I'm kind of new at this. I have just discovered the control
the radio buttons are on are a radiobuttonlist control. Should I make them
radio buttons and put them in a group box? The help indicates it is easier
to determine which one was selected, in a radiobuttonlist control.

"kea" wrote:
As Morten says, you just disable the specific radiobutton. F.x. if we
have 3 radiobuttons (rb1, rb2, rb3) in a groupbox (grp_radiobuttons)
and you want to disable rb2, then you just write rb2.enabled = false.

Sep 30 '05 #5
I'm afraid I'm not familiar with the RadioButtonList (for future reference indicate if the control in question is a web control as they differ somewhat from windows controls), but I don't think you can enable a single RadioButton in that list. You can as you say use individual RadioButtons in a container control like a GroupBox and enable and disable them as you like.

--
Happy coding!
Morten Wennevik [C# MVP]
Sep 30 '05 #6
Thanks

"Morten Wennevik" wrote:
I'm afraid I'm not familiar with the RadioButtonList (for future reference indicate if the control in question is a web control as they differ somewhat from windows controls), but I don't think you can enable a single RadioButton in that list. You can as you say use individual RadioButtons in a container control like a GroupBox and enable and disable them as you like.

--
Happy coding!
Morten Wennevik [C# MVP]

Sep 30 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: VK | last post by:
Hi! What I'm missing in following code? Cannot get the values of radiobuttons. Starting only one class (GetVariant), it works. When I put two classes together, it doesn't. Regards, VK from...
11
by: William Gill | last post by:
I am placing radiobuttons in a 4 X 4 matrix (using loops) and keep references to them in a 2 dimensional list ( rBtns ). It works fine, and I can even make it so only one button per column can be...
0
by: rodrigo | last post by:
I have a Asp.net table control that I dynamically add rows from a SQL database. Inside the table, I add radiobuttons and they all have different ID numbers according to BindChain() Looking In...
3
by: sofie | last post by:
Hello all, I use the following javascript function in a html document to set the level of one of eight available radiobuttons. The line that's commented out works fine under IE, but I need to...
3
by: dave | last post by:
I have half a dozen web form radio buttons on a web form. Each of them is set to postback=true. However, if for instance radiobutton1 is already selected and the user selects it again, it performs...
6
by: Leonard | last post by:
I have several radio buttons for the user to choose from. I need to enable or disable a particular radio button, depending on a certain condition. How can I do this? Thanks, Leonard
6
by: Radiobutton via DotNetMonster.com | last post by:
i need help with radiobuttons. i am useing 1button and 2 radiobuttons i am trying to make it so when u select a radiobutton and hit button1 it will clear radiobuttons 1 and 2. -- Message...
4
by: Igor | last post by:
RadioButton have property Checked (true or false). If I make RadioButtons with code, without drawing by mouse than I have problems. I write like this: Dim rb(0 To 2) As RadioButton Dim n As...
8
by: =?Utf-8?B?UmljaA==?= | last post by:
If you enclose a group of radiobuttons (option buttons in MS Access) in an option group control (a frame control) in Access -- the frame control will return the index of the option button that is...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.