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

##Help me plz: 15 ComboBox on a form----how to refer to them in a For loop

5
i have got 15 combo Boxs on the form
they are named cbo1 - cbo15

the following works just fun
strY= cbo1.Text;

but i wanna learn the for loop way to do it....
i have tried many times...can't figure this out.



how can i refer to the 15 combo boxes in the loop.....

for (int intI =1 ; intI < 16; intI ++)
{
ComboBox cbo = ComboBox (cbo+(intI).ToString()) ;
strY = cbo.Text;
}

error message: 'System.Windows.Forms.ComboBox' denotes a 'class' which is not valid in the given context


thx a lot....

Regards

Sky
Nov 3 '06 #1
1 1051
nmsreddi
366 256MB
hello

as you want use a for loop for controls yopu have to use foreach(){} syntax

helps you.first take an array of controls and then try to loop them


regards

nmsreddy
Nov 3 '06 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: - ions | last post by:
Hi, im a just wondering how to add elements into a JComboBox through a loop ie. just say i wanted to add the numbers 1 throught to 100. It seems easy but im having a bit of trouble. One problem...
1
by: Nuno Caldas | last post by:
Ok , here's the deal , ive got a DB where there is a table called products wich as the "ID", "description" , "Stock" fields in it , i have another one in wich i have "ID" , "Counted". What i need...
1
by: fiaolle | last post by:
Hi I have a DataGrid with ComboBox columns. I want the same thing to happen as when a user clicks and chooses an item in the ComboBox. When a user stands in the last row (new row) and clicks for...
0
by: James | last post by:
I'm trying to reassign text fields based upon the the values being read in. It errors out when it gets to: ctrTextFieldNames(intFieldsRead).Text = Microsoft.VisualBasic.Left(strReadVendorFile,...
4
by: noob114 | last post by:
Hi guys, I have to write a program with a loop that stops at the user's inputted sum. A sample output would be this. Enter your test value 123 Even integer Sum 2 2 4 ...
5
by: complexc | last post by:
I am having trouble figuring out how to stop from the loop using EOF. I need to use a while loop in main and use EOF to stop it. Can anyone guide me. This is part of the program I was asked to do:...
7
by: ankur saxena | last post by:
hey plz if some body could advise me a gud project in c++..which could be big and yeald my all concepts of c++ best u know... thanx..
6
by: jenipriya | last post by:
Hi all... its very urgent.. please........i m a beginner in oracle.... Anyone please help me wit dese codes i hv tried... and correct the errors... The table structures i hav Employee (EmpID,...
1
by: sasha80 | last post by:
Hello everybody here is Sasha from russia ... I'm working as .Net 2005 application developer I prepare to gain MCPD certificate i have to pass three exams 70536(first) 70526(second)...
2
by: lyle777 | last post by:
I need help with using continue in my loop. they say that when using continue in the loop that is nested, depending on the condition of the continue statement, execution should jump to the...
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
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...
0
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,...
0
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...

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.