473,385 Members | 1,409 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,385 software developers and data experts.

How to loop thru each controls ?

Kay
Hi all,

I have a 42 groupboxes in a panel, each groupbox has 3 check boxes in it.

The 42 groupboxes are actually in a panel, and the panel is on the second
tab page of a tab control...

What I need to do is to find out the value of each checkbox (i.e. checked or
not), can anyone tell me how to do it?

I think it would be easier if I can create an array of groupbox like in vb6,
but it seems it's not avaliable in .net ....

Thanks~

Kay
Jan 5 '06 #1
2 1156
"Kay" <kk@micxsoft.com> schrieb:
I have a 42 groupboxes in a panel, each groupbox has 3 check boxes in it.

The 42 groupboxes are actually in a panel, and the panel is on the second
tab page of a tab control...

What I need to do is to find out the value of each checkbox (i.e. checked
or not), can anyone tell me how to do it?


You will have to recursively enumerate the controls. Check out the
implementation of 'FindControl' here:

Accessing controls by their names or indices
<URL:http://dotnet.mvps.org/dotnet/faqs/?id=controlbynameindex&lang=en>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Jan 5 '06 #2

You don't say how you identify each checkbox, but try this (not tested, but
I think it works):

Dim al As New List(Of CheckBox)

Foreach gb as GroupBox in panel.Controls
Foreach rb as CheckBox in gb.Controls
If rb.Checked Then
al.Add(rb)
End If
Next
Next

Chuck Gantz
"Kay" <kk@micxsoft.com> wrote in message
news:e7**************@TK2MSFTNGP12.phx.gbl...
Hi all,

I have a 42 groupboxes in a panel, each groupbox has 3 check boxes in it.

The 42 groupboxes are actually in a panel, and the panel is on the second
tab page of a tab control...

What I need to do is to find out the value of each checkbox (i.e. checked
or not), can anyone tell me how to do it?

I think it would be easier if I can create an array of groupbox like in
vb6, but it seems it's not avaliable in .net ....

Thanks~

Kay

Jan 6 '06 #3

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

Similar topics

1
by: Jeremy Langworthy | last post by:
Hi I have a dynamicly generated form (well the elements are at least) that looks something like this: while( not end of returned records): <input name="plan_id" type="checkbox" id=""...
2
by: sparks | last post by:
I was going to loop thru the tables and change some properties. 10 <<<<<< prp.value --prp.name = Type False <<<<prp.value --prp.name = allow zero length 10 <<<<<< prp.value --prp.name = Type...
4
by: VB Programmer | last post by:
How can I loop thru all textboxes on a form? I want to remove any single quotes in the data entry. I was thinking something like this: For Each c As Control In Me.Controls Dim t As TextBox =...
2
by: Michael Beck | last post by:
I am new to .net programming and I want to know if I can loop thru a specified number of controls on an html form. In Access, the code looks like this: For i = 1 to 10 Me("txtAlternate" & i) =...
3
by: =?Utf-8?B?VmFuZXNzYQ==?= | last post by:
Here is my loop and it runs fine: ---------------------------------------------------- sSQL = "SELECT * FROM STORE_ITEMS" Set DataRec = DB.execute(sSQL) if not DataRec.EOF then do while not...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.