473,698 Members | 2,551 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Looping through radiobuttons

Hi All,

I have 5 radiobuttons in a groupbox and I'm trying to uncheck all of them:

Dim ctrl as Control
For each ctrl in GB.Controls
If TypeOf ctrl Is RadioButton Then
ctrl.Checked=Fa lse 'This doesn't work!
Endif
Next

I can change ctrl from Control to RadioButton, but there are other controls
in the groupbox (not radiobutons).

Is there an easier way to uncheck all of the radiobuttons in a groupbox?

TIA
Lee
Nov 21 '05 #1
3 3300

"lgbjr"

You get probably a lot of answers on this easy one.

DirectCast(ctrl ,RadioButton).C hecked=False

Cor
Nov 21 '05 #2

lgbjr wrote:
Hi All,

I have 5 radiobuttons in a groupbox and I'm trying to uncheck all of them:

Dim ctrl as Control
For each ctrl in GB.Controls
If TypeOf ctrl Is RadioButton Then
ctrl.Checked=Fa lse 'This doesn't work!
DirectCast(ctrl , RadioButton).Ch ecked = False 'This should work! :)
Endif
Next
Is there an easier way to uncheck all of the radiobuttons in a groupbox?


Don't think so.

--
Larry Lard
Replies to group please

Nov 21 '05 #3
LOL!

MyBrain.enabled =False

thanks
Lee

"Cor Ligthert" <no************ @planet.nl> wrote in message
news:Os******** ******@TK2MSFTN GP14.phx.gbl...

"lgbjr"

You get probably a lot of answers on this easy one.

DirectCast(ctrl ,RadioButton).C hecked=False

Cor

Nov 21 '05 #4

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

Similar topics

0
869
by: Robert H | last post by:
I am testing a solution that iterates through a database forming HTML as it's output using Response.Writes.. The part i'm stumped on is.. If i have a webforms Button on the page and I click it for postback, how could i assign a variable to the checked radiobutton ? the radiobuttons could grow to any size.. all have the same name making them a group but... how can i bring that checked value back into VS.net
4
2103
by: news.microsoft.com | last post by:
Hello, I have two databound radiobuttons which have advanced databinding properties of onpropertychanged enabled so that I can raise the columnchanged event whenever the radiobuttons are changed. In the columnchanged event I am simply accepting changes into the dataset. There is no dataadapter because it is a standalone dataset. When one radiobutton is already checked (as opposed to neither) and I select
0
1424
by: PaulS | last post by:
Hello! I put on Form PictureBox and I set big image. Next I put many radiobuttons (80) on PictureBox, but I have problem. I want that 10 radiobuttons have own Checked, next part of 10 radiobuttons have own Checked, etc. I tried add GroupBox on PictureBox, next add RadioButtons. But there is problem that I can't set visible only RadioButtons on image (GroupBox must be hidden). I tried option: "Send to Back" but it hide also
4
1702
by: PedroVision | last post by:
I have a VB 2005 form with 140 different radiobuttons... Some are "checked", some are not... I want to reset all radiobuttons to "unchecked". I've been searching and trying differnet things...there must be a way to access radiobuttons by their "names"... Typical names used include... RadioButton011
0
8609
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9169
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
7738
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6528
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5861
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4371
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4622
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3052
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2007
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.