Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

I have two combobox .. and i have some items in both combobox
now i need to check the item in both combobox if same item
is Present in both combobox i need to display that item in
message box

Answer Posted / pavel

bool found = false;
string item = string.Empty;
foreach (string item1 in comboBox1.Items)
{
foreach (string item2 in comboBox2.Items)
if (item1 == item2)
{
item = item1;
found = true;
break;
}
if (found) break;
}
MessageBox.Show(found ? item : "Not found");

Is This Answer Correct ?    3 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

To which namespace does the control class belong?

956


Which command prompt utility is used to convert a resource file from the text format into the binary format?

1074


Explain the difference between listbox and combo box?

957


What is form based application?

961


Suppose I am implementing one windows form. I am inserting some values into ms access. In that table 5 columns there. But I want to insert three columns only. When I am clicking another button then other two values also insert into that table?

971


Name the property which is used to specify the source from where the crystal reports would be accessed.

984


What are the components of gui for windows?

951


What is the full form of gac?

1162


How to use the FindControl() function to preselect an item in my dropdownlist?

2155


Explain how to split a column header in gridview using c#.net?

1005


Explain how many number of events does the timer controls?

930


What is form and its types?

988


Which dialog box allows users to switch to another area of the application?

1039


What is the difference between the add() and insert() methods of a listbox control?

1030


What are windows applications?

905