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
Explain the difference between listbox and combo box?
Explain how many number of events does the timer controls?
Which property of the errorprovider control automatically sets to the form to which?
Which event occurs when a user drags an item in a treeview or listview control?
Name the property which is used to lock a textbox to enter data?
What is the extension of a compiled help project file?
How insert record in the database?
What are the different cloud platforms?
What is an example of form?
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?
What is the extension of the windows installer file?
Explain how to split a column header in gridview using c#.net?
Name the event that enables the user to prevent shifting of focus from control until all the validation rules have been met.
Explain how to find the current record position in data control?
How many navigational features are provided by visual studio.net ide?