473,398 Members | 2,404 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,398 software developers and data experts.

combobox index

hi group..
i want to store all my combobox's indexes into an array....what coding should i do??plz help...
Apr 11 '12 #1
2 1830
michaeldebruin
134 100+
I am not sure, but using the following line might be usefull to you. Atleast if this is what you are looking for.

<name of your combobox>.items and then use a foreach loop to create a new array foreach item.
Apr 11 '12 #2
Below code can be used for copying combobox items in an array.
Expand|Select|Wrap|Line Numbers
  1. string[] strArray = new string[comboBox1.Items.Count];
  2. for (int i = 0; i < comboBox1.Items.Count; i++)
  3. {
  4.     strArray[i] = comboBox1.Items[i].ToString();
  5. }
  6.  
Apr 12 '12 #3

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

Similar topics

4
by: Strahimir Antoljak | last post by:
Has anyone experienced problems with a combo box SelectIndex property? Is there a limit to the number of Items for a combo box? Namely, when I set programmatically ComboBox.SelectIndex...
4
by: jon f kaminsky | last post by:
Hi- I've seen this problem discussed a jillion times but I cannot seem to implement any advice that makes it work. I am porting a large project from VB6 to .NET. The issue is using the combo box...
5
by: Eric A. Johnson | last post by:
Hi Everyone, I am at my wit's end here. I have a combobox (combyQueryTitle) that I need to use in order to select a query for my database project. Therefore, I am using the...
2
by: wallermj | last post by:
I want to be able to compare the old combobox index to the newly selected combobox index in the SelectIndexChanged event. How can I do that? I know I could store the last selected value for the...
5
by: Nadav | last post by:
Hello. I have a combobox in a form (cmbNames). The DataSource property is some arraylist of strings. I have a button which is supposed to "clean" the combobox and deselect any item. Therefore, I...
0
by: nedier26 | last post by:
Hi everyone, I have a control array that contains two ComboBox and I used a Select Case to make the difference between the ComboBox and I also diferentiate the two ComboBox using their Index...
5
by: =?Utf-8?B?bWljaGFlbCBzb3JlbnM=?= | last post by:
I want to create a customized ComboBox where the methods ComboBox.Items.Add and ComboBox.Items.Insert will behave thusly: -- If the item is not present, add it. -- If the item is present, set the...
2
by: TomasART | last post by:
Hi All, At first i will give thanks of all who have help me in the other thread. Know my combo works :). Ok, you know the combo calls a javascript function in the onchage statement. $combo =...
0
by: =?Utf-8?B?Y2xhcmE=?= | last post by:
Hi all, I use ComboxBoxes to input and display lookup field values in a database table. I want to use the value in database as the index of the items in a ComboBox so the matching items will be...
5
by: Kevinp | last post by:
I've spent the last four hours Google searching for a way to disable items in a Combobox. I found one example in C++ which I can't get to work and another in C# that I couldn't get to work either....
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?
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...
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
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...
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
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,...

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.