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
To which namespace does the control class belong?
Which command prompt utility is used to convert a resource file from the text format into the binary format?
Explain the difference between listbox and combo box?
What is form based application?
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?
Name the property which is used to specify the source from where the crystal reports would be accessed.
What are the components of gui for windows?
What is the full form of gac?
How to use the FindControl() function to preselect an item in my dropdownlist?
Explain how to split a column header in gridview using c#.net?
Explain how many number of events does the timer controls?
What is form and its types?
Which dialog box allows users to switch to another area of the application?
What is the difference between the add() and insert() methods of a listbox control?
What are windows applications?