C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Interview   Jobs   Projects   Offshore Development    
Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing | Talk to Us |



My Profile

Gifts

Active Members
TodayLast 7 Days more...









How to copy items from one ComboBox control to other


Posted Date: 12 Jun 2008    Resource Type: Code Snippets    Category: C# Syntax

Posted By: shakti singh tanwar       Member Level: Diamond
Rating:     Points: 10



The following code sample shows how to copy items from one ComboBox control to other Without looping through each items.You can use this code to copy items of Combobox,ListBox,RadioButtonList etc i.e. each control that has Items collection.

object[] obj = new object[comboBox1.Items.Count];
comboBox1.Items.CopyTo(obj, 0);
comboBox2.Items.AddRange(obj);




Responses

Author: Rakesh Kumar    13 Jun 2008Member Level: Bronze   Points : 0
Nice Code Sir
Thanx for info


Author: RamyaNaidu    06 Aug 2008Member Level: Silver   Points : 1
CB1.Items.Add("an item");
object[] a= new object[CB1.Items.Count];
CB1.Items.CopyTo(a,0);
CB2.Items.AddRange(a);




Feedbacks      
Popular Tags   What are tags ?   Search Tags  
(No tags found.)

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: How to compares Case insensitive strings
Previous Resource: How to select Different Items of ListBox & Insert Them into Different Fields of Table.
Return to Discussion Resource Index
Post New Resource
Category: C# Syntax


Post resources and earn money!
 
Related Resources



dotNet Slackers   BizTalk Adaptors    Web Design

conference calls

Contact Us    Privacy Policy    Terms Of Use